Ignore:
Timestamp:
29 Dec 2014, 16:12:24 (10 years ago)
Author:
Henrik Bettermann
Message:

Define contract title in product. Customers must not be able to edit contract titles.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba/products
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/interfaces.py

    r12327 r12336  
    5757        )
    5858
     59    contract_title = schema.TextLine(
     60        title = _(u'Product Title'),
     61        description = _('Product title if empty'),
     62        required = False,
     63        )
     64
    5965    contract_category = schema.Choice(
    6066        title = _(u'Contract Category'),
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/product.py

    r12334 r12336  
    5151        return cc_dict[self.contract_category]
    5252
     53    @property
     54    def contract_autotitle(self):
     55        if self.contract_title:
     56            return self.contract_title
     57        return self.title
     58
    5359Product = attrs_to_fields(Product)
    5460
  • main/waeup.ikoba/trunk/src/waeup/ikoba/products/tests/test_export.py

    r12315 r12336  
    6262        result = open(self.outfile, 'rb').read()
    6363        self.assertTrue(
    64             'contract_category,options,product_id,title,users_with_local_roles\r\n'
    65             'license,"[(u\'Base Fee\', u\'800.6\', u\'usd\')]",LIC,Unnamed,'
     64            'contract_category,contract_title,options,'
     65            'product_id,title,users_with_local_roles\r\n'
     66            'license,,"[(u\'Base Fee\', u\'800.6\', u\'usd\')]",LIC,Unnamed,'
    6667            '"[{\'user_name\': u\'john\', \'local_role\': '
    6768            'u\'johnsrole\'}]"\r\n'
     
    7677        result = open(self.outfile, 'rb').read()
    7778        self.assertTrue(
    78             'contract_category,options,product_id,title,users_with_local_roles\r\n'
    79             'license,"[(u\'Base Fee\', u\'800.6\', u\'usd\')]",LIC,Unnamed,'
     79            'contract_category,contract_title,options,'
     80            'product_id,title,users_with_local_roles\r\n'
     81            'license,,"[(u\'Base Fee\', u\'800.6\', u\'usd\')]",LIC,Unnamed,'
    8082            '"[{\'user_name\': u\'john\', \'local_role\': '
    8183            'u\'johnsrole\'}]"\r\n'
Note: See TracChangeset for help on using the changeset viewer.