Ignore:
Timestamp:
10 Feb 2015, 13:22:23 (10 years ago)
Author:
Henrik Bettermann
Message:

Title must be stored with the contract. Otherwise no title will be displayed if product is removed.

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

Legend:

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

    r12535 r12580  
    13371337    def save(self, **data):
    13381338        msave(self, **data)
     1339        self.context.title = self.context.product_object.contract_autotitle
    13391340        self.context.tc_dict = self.context.product_object.tc_dict
    13401341        isCustomer = getattr(
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/contracts.py

    r12573 r12580  
    7575        self.last_product_id = None
    7676        self.tc_dict = {}
     77        self.title = None
    7778        return
    7879
     
    105106        except IndexError:
    106107            return
    107 
    108     @property
    109     def title(self):
    110         return getattr(
    111             getattr(self, 'product_object', None),
    112             'contract_autotitle', None)
    113108
    114109    @property
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/sample_contract_data.csv

    r12366 r12580  
    1 class_name,contract_id,reg_number,product_object,document_object,product_options,tc_dict
    2 SampleContract,c3,1,SAM,DOC1,"[('Base Fee', '800.6', 'USD')]",{'en':'Hello World'}
    3 SampleContract,c4,2,SAM,DOC1,[],{}
    4 SampleContract,c5,3,SAM,DOC1,[],{}
    5 SampleContract,,1,SAM,DOC1,[],{}
    6 SampleContract,c5,2,SAM,DOC1,[],{}
    7 SampleContract,c6,3,SAM,NONEXISTENT,[],{}
    8 SampleContract,c7,3,NONEXISTENT,DOC1,[],{}
     1class_name,contract_id,reg_number,product_object,document_object,product_options,tc_dict,title
     2SampleContract,c3,1,SAM,DOC1,"[('Base Fee', '800.6', 'USD')]",{'en':'Hello World'},Nice Contract
     3SampleContract,c4,2,SAM,DOC1,[],{},
     4SampleContract,c5,3,SAM,DOC1,[],{},
     5SampleContract,,1,SAM,DOC1,[],{},
     6SampleContract,c5,2,SAM,DOC1,[],{},
     7SampleContract,c6,3,SAM,NONEXISTENT,[],{},
     8SampleContract,c7,3,NONEXISTENT,DOC1,[],{},
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py

    r12537 r12580  
    498498        fail_file = open(fail_file).read()
    499499        self.assertEqual(fail_file,
    500             'reg_number,contract_id,class_name,product_object,tc_dict,document_object,product_options,--ERRORS--\r\n'
    501             '2,c5,SampleContract,SAM,{},DOC1,[],This object already exists. Skipping.\r\n'
    502             '3,c6,SampleContract,SAM,{},NONEXISTENT,[],document_object: Invalid value\r\n'
    503             '3,c7,SampleContract,NONEXISTENT,{},DOC1,[],product_object: Invalid value\r\n'
     500            'reg_number,contract_id,title,class_name,product_object,tc_dict,document_object,product_options,--ERRORS--\r\n'
     501            '2,c5,,SampleContract,SAM,{},DOC1,[],This object already exists. Skipping.\r\n'
     502            '3,c6,,SampleContract,SAM,{},NONEXISTENT,[],document_object: Invalid value\r\n'
     503            '3,c7,,SampleContract,NONEXISTENT,{},DOC1,[],product_object: Invalid value\r\n'
    504504            )
    505505        contract = self.processor.getEntry(dict(reg_number='1',
     
    523523        self.assertTrue(
    524524            'INFO - system - Customer Sample Contract Processor - sample_contract_data - '
    525             'X666666 - %s - updated: product_object=SAM, tc_dict={}, document_object=DOC1, '
     525            'X666666 - %s - updated: title=, product_object=SAM, tc_dict={}, document_object=DOC1, '
    526526            'product_options=[]' % conid
    527527            in logcontent)
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12553 r12580  
    14401440        self.contract.product_object = self.product
    14411441        self.contract.tc_dict = {'en': u'<strong>Hello world</strong>'}
     1442        self.contract.title = u'Contract Title'
    14421443        self.browser.open(self.customer_path + '/contracts/CON1')
    14431444        self.browser.getLink("Download contract slip").click()
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_export.py

    r12500 r12580  
    278278            'Contract created by system\'],,'
    279279            'SAM,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",'
    280             'created,{\'en\': u\'Hello world\'},Our Sample Product,A111111\r\n',
     280            'created,{\'en\': u\'Hello world\'},,A111111\r\n',
    281281            result
    282282            )
     
    298298            'Contract created by system\'],,'
    299299            'SAM,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",'
    300             'created,{\'en\': u\'Hello world\'},Our Sample Product,A111111\r\n',
     300            'created,{\'en\': u\'Hello world\'},,A111111\r\n',
    301301            result
    302302            )
     
    318318            'Contract created by system\'],,'
    319319            'SAM,"[(u\'Base Fee\', u\'800.6\', u\'USD\')]",'
    320             'created,{\'en\': u\'Hello world\'},Our Sample Product,A111111\r\n',
    321             result
    322             )
    323         return
    324 
     320            'created,{\'en\': u\'Hello world\'},,A111111\r\n',
     321            result
     322            )
     323        return
     324
Note: See TracChangeset for help on using the changeset viewer.