Ignore:
Timestamp:
29 Dec 2014, 06:52:30 (10 years ago)
Author:
Henrik Bettermann
Message:

Adjust to changes made in base package.

Location:
main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/contracts.py

    r12286 r12335  
    2828from ikobacustom.skeleton.interfaces import MessageFactory as _
    2929from ikobacustom.skeleton.customers.interfaces import (
    30     ISkeletonContract, ISkeletonContractEdit)
     30    ISkeletonContract, ISkeletonContractEdit, ISkeletonContractProcess)
    3131
    3232
     
    3636
    3737    grok.implements(
    38         ISkeletonContract, ISkeletonContractEdit, ICustomerNavigation)
     38        ISkeletonContractProcess,
     39        ISkeletonContract,
     40        ISkeletonContractEdit,
     41        ICustomerNavigation)
    3942
    4043    contract_category = 'sample'
  • main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/interfaces.py

    r12292 r12335  
    2222from waeup.ikoba.customers.vocabularies import (
    2323    ConCatProductSource, CustomerDocumentSource)
     24from waeup.ikoba.products.productoptions import ProductOptionField
    2425from ikobacustom.skeleton.interfaces import MessageFactory as _
    2526
     
    5152        )
    5253
     54class ISkeletonContractProcess(ISkeletonContract):
     55    """Interface for processing contract data.
     56    """
     57
     58    product_options = schema.List(
     59        title = _(u'Options/Fees'),
     60        value_type = ProductOptionField(),
     61        required = False,
     62        readonly = False,
     63        default = [],
     64        )
     65
    5366class ISkeletonContractEdit(ISkeletonContract):
    5467    """Interface for editing sample contract data by customers.
  • main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/customers/tests/test_browser.py

    r12292 r12335  
    157157        self.assertMatches(result,
    158158            'class_name,contract_category,contract_id,document_object,'
    159             'history,last_product_id,product_object,state,title,user_id\r\n'
     159            'history,last_product_id,product_object,product_options,'
     160            'state,title,user_id\r\n'
    160161            'SkeletonContract,sample,%s,,'
    161162            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    162             ',,,created,My first contract,K1000000\r\n'
     163            ',,,[],created,My first contract,K1000000\r\n'
    163164            % self.contract.contract_id)
    164165        # We can reimport the file if we change the header (user_id -> customer_id)
     
    166167        open(self.outfile, 'wb').write(
    167168            'class_name,contract_category,contract_id,document_object,'
    168             'history,last_product_id,product_object,state,title,customer_id\r\n'
     169            'history,last_product_id,product_object,product_options,'
     170            'state,title,user_id\r\n'
    169171            'SkeletonContract,sample,%s,,'
    170172            '[u\'2014-12-21 22:26:00 WAT - Contract created by system\']'
    171             ',,,created,My first contract,K1000000\r\n'
     173            ',,,[],created,My first contract,K1000000\r\n'
    172174            % self.contract.contract_id)
    173175        result = processor.doImport(
    174176            self.outfile,
    175177            ['class_name','contract_category','contract_id','document_object',
    176             'history','last_product_id','product_object','state','title','customer_id'],
     178            'history','last_product_id','product_object','product_options',
     179            'state','title','customer_id'],
    177180            mode='create')
    178181        num, num_fail, finished_path, failed_path = result
     
    184187            self.outfile,
    185188            ['class_name','contract_category','contract_id','document_object',
    186             'history','last_product_id','product_object','state','title','customer_id'],
     189            'history','last_product_id','product_object','product_options',
     190            'state','title','customer_id'],
    187191            mode='create')
    188192        num_succ, num_fail, finished_path, failed_path = result
     
    192196            self.outfile,
    193197            ['class_name','contract_category','contract_id','document_object',
    194             'history','last_product_id','product_object','state','title','customer_id'],
     198            'history','last_product_id','product_object','product_options',
     199            'state','title','customer_id'],
    195200            mode='update')
    196201        num_succ, num_fail, finished_path, failed_path = result
  • main/ikobacustom.skeleton/trunk/src/ikobacustom/skeleton/products/tests/test_browser.py

    r12269 r12335  
    5252        result = open(self.outfile, 'rb').read()
    5353        self.assertEqual(result,
    54             'contract_category,product_id,title,users_with_local_roles\r\n'
    55             'license,LIC,Unnamed,[]\r\n')
     54            'contract_category,options,product_id,title,users_with_local_roles\r\n'
     55            'license,[],LIC,Unnamed,[]\r\n')
    5656        # We can import the same file.
    5757        processor = SkeletonProductProcessor()
    5858        result = processor.doImport(
    5959            self.outfile,
    60             ['contract_category','product_id','title','users_with_local_roles'],
     60            ['contract_category','options,', 'product_id','title',
     61            'users_with_local_roles'],
    6162            mode='create')
    6263        num, num_fail, finished_path, failed_path = result
     
    6869        result = processor.doImport(
    6970            self.outfile,
    70             ['contract_category','product_id','title','users_with_local_roles'],
     71            ['contract_category','options','product_id','title',
     72            'users_with_local_roles'],
    7173            mode='create')
    7274        num, num_fail, finished_path, failed_path = result
     
    7678        result = processor.doImport(
    7779            self.outfile,
    78             ['contract_category','product_id','title','users_with_local_roles'],
     80            ['contract_category','options','product_id','title',
     81            'users_with_local_roles'],
    7982            mode='update')
    8083        num, num_fail, finished_path, failed_path = result
Note: See TracChangeset for help on using the changeset viewer.