Changeset 12324 for main/waeup.ikoba/trunk
- Timestamp:
- 26 Dec 2014, 09:35:21 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/customers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py
r12289 r12324 30 30 from waeup.ikoba.customers.vocabularies import ( 31 31 contextual_reg_num_source, GenderSource, nats_vocab, 32 ConCatProductSource, CustomerDocumentSource) 32 ConCatProductSource, CustomerDocumentSource, 33 ProductOptionSource) 33 34 34 35 … … 310 311 ) 311 312 313 product_options = schema.List( 314 title = _(u'Options/Fees'), 315 value_type = schema.Choice( 316 source=ProductOptionSource(), 317 required = True, 318 ), 319 required = False, 320 readonly = False, 321 default = [], 322 ) 323 312 324 313 325 class IContractEdit(IContract): -
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/vocabularies.py
r12127 r12324 160 160 def getTitle(self, context, value): 161 161 return "%s - %s" % (value.document_id, value.title) 162 163 class ProductOptionSource(BasicContextualSourceFactory): 164 """A product option source delivers all options belonging to 165 a selected product. 166 """ 167 168 def getValues(self, context): 169 product = getattr(context, 'product_object', None) 170 if product is None: 171 return [] 172 return product.options 173 174 def getToken(self, context, value): 175 return value.title 176 177 def getTitle(self, context, value): 178 return "%s @ %s %s" % (value.title, value.fee, value.currency)
Note: See TracChangeset for help on using the changeset viewer.