Changeset 12289 for main/waeup.ikoba


Ignore:
Timestamp:
21 Dec 2014, 22:17:06 (10 years ago)
Author:
Henrik Bettermann
Message:

Uups, we forgot to index and export the contract user_id which is always the customer_id for contracts.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/customers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/catalog.py

    r12155 r12289  
    131131    last_product_id = grok.index.Field(attribute='last_product_id')
    132132    contract_category = grok.index.Field(attribute='contract_category')
     133    user_id = grok.index.Field(attribute='user_id')
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py

    r12258 r12289  
    117117            return None
    118118
     119    @property
     120    def user_id(self):
     121        if self.customer is not None:
     122            return self.customer.customer_id
     123        return
     124
    119125    def writeLogMessage(self, view, message):
    120126        return self.__parent__.__parent__.writeLogMessage(view, message)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/interfaces.py

    r12279 r12289  
    291291    is_approvable = Attribute('Contract approvable by officer')
    292292    translated_class_name = Attribute('Translatable class name')
     293    user_id = Attribute('Id of a user, actually the id of the customer')
    293294
    294295    contract_id = schema.TextLine(
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py

    r12279 r12289  
    257257            'class_name,contract_category,contract_id,document_object,'
    258258            'history,last_product_id,'
    259             'product_object,state,title\r\n'
    260 
    261             'SampleContract,sample,CON1,,[],,,,\r\n'
     259            'product_object,state,title,user_id\r\n'
     260
     261            'SampleContract,sample,CON1,,[],,,,,\r\n'
    262262            )
    263263        return
     
    273273            'class_name,contract_category,contract_id,document_object,'
    274274            'history,last_product_id,'
    275             'product_object,state,title\r\n'
     275            'product_object,state,title,user_id\r\n'
    276276
    277277            'SampleContract,sample,CON1,DOC1,[u\'2014-12-04 12:10:46 UTC - '
    278278            'Contract created by system\'],,'
    279             'SAM,created,My Contract\r\n',
     279            'SAM,created,My Contract,A111111\r\n',
    280280            result
    281281            )
     
    292292            'class_name,contract_category,contract_id,document_object,'
    293293            'history,last_product_id,'
    294             'product_object,state,title\r\n'
     294            'product_object,state,title,user_id\r\n'
    295295
    296296            'SampleContract,sample,CON1,DOC1,[u\'2014-12-04 12:10:46 UTC - '
    297297            'Contract created by system\'],,'
    298             'SAM,created,My Contract\r\n',
     298            'SAM,created,My Contract,A111111\r\n',
    299299            result
    300300            )
     
    311311            'class_name,contract_category,contract_id,document_object,'
    312312            'history,last_product_id,'
    313             'product_object,state,title\r\n'
     313            'product_object,state,title,user_id\r\n'
    314314
    315315            'SampleContract,sample,CON1,DOC1,[u\'2014-12-04 12:10:46 UTC - '
    316316            'Contract created by system\'],,'
    317             'SAM,created,My Contract\r\n',
    318             result
    319             )
    320         return
    321 
     317            'SAM,created,My Contract,A111111\r\n',
     318            result
     319            )
     320        return
     321
Note: See TracChangeset for help on using the changeset viewer.