Changeset 12112 for main/waeup.ikoba/trunk/src/waeup/ikoba
- Timestamp:
- 2 Dec 2014, 06:51:59 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py
r12103 r12112 1126 1126 form = self.request.form 1127 1127 customer = self.context.__parent__ 1128 apptype = form.get('apptype', None)1128 contype = form.get('contype', None) 1129 1129 # Here we can create various instances of Contract derived 1130 # classes depending on the apptype parameter given in form.1131 contract = createObject('waeup.%s' % apptype)1130 # classes depending on the contype parameter given in form. 1131 contract = createObject('waeup.%s' % contype) 1132 1132 self.context.addContract(contract) 1133 apptype = getUtility(ICustomersUtils).SELECTABLE_CONTYPES_DICT[apptype]1133 contype = getUtility(ICustomersUtils).SELECTABLE_CONTYPES_DICT[contype] 1134 1134 self.flash(_('${a} created.', 1135 mapping = {'a': apptype}))1135 mapping = {'a': contype})) 1136 1136 self.context.writeLogMessage( 1137 self,'added: %s %s' % ( apptype, contract.contract_id))1137 self,'added: %s %s' % (contype, contract.contract_id)) 1138 1138 self.redirect(self.url(self.context)) 1139 1139 return -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser_templates/contractaddform.pt
r12099 r12112 8 8 </td> 9 9 <td> 10 <select id=" apptype" name="apptype" size="1"10 <select id="contype" name="contype" size="1" 11 11 class="form-control half"> 12 12 <option tal:repeat="item view/selectable_contypes" -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py
r12103 r12112 1066 1066 self.browser.getLink("Contracts").click() 1067 1067 self.browser.getLink("Add contract").click() 1068 self.browser.getControl(name=" apptype").value = ['SampleContract']1068 self.browser.getControl(name="contype").value = ['SampleContract'] 1069 1069 self.browser.getControl("Create contract").click() 1070 1070 self.assertTrue('Sample Contract created.' in self.browser.contents) … … 1129 1129 self.browser.getLink("Contracts").click() 1130 1130 self.browser.getLink("Add contract").click() 1131 self.browser.getControl(name=" apptype").value = ['SampleContract']1131 self.browser.getControl(name="contype").value = ['SampleContract'] 1132 1132 self.browser.getControl("Create contract").click() 1133 1133 self.assertTrue('Sample Contract created.' in self.browser.contents)
Note: See TracChangeset for help on using the changeset viewer.