~unifield-team/unifield-wm/sync-env2

« back to all changes in this revision

Viewing changes to mkdb.py

  • Committer: jf
  • Date: 2017-06-09 13:42:32 UTC
  • Revision ID: jfb@tempo-consulting.fr-20170609134232-ifx79xq41jah2crc
Intersection parnters @hq

Show diffs side-by-side

added added

removed removed

Lines of Context:
962
962
        #wizard = self.db.wizard('user.access.configurator', {'file_to_import_uac': data})
963
963
        #wizard.do_process_uac()
964
964
 
 
965
    def test_70_create_intersection(self):
 
966
        partner = self.db.get('res.partner')
 
967
        account = self.db.get('account.account')
 
968
        for tc in test_cases:
 
969
            if (issubclass(tc, coordon_creation) or issubclass(tc, projectn_creation)) and tc.hq.index != self.index:
 
970
                if tc.db is None:
 
971
                    db_name = tc.name_format % tc.getNameFormat()
 
972
                else:
 
973
                    db_name = tc.db.name
 
974
                partner.create({
 
975
                    'name': db_name,
 
976
                    'partner_type': 'section',
 
977
                    'po_by_project': 'project',
 
978
                    'customer': True,
 
979
                    'supplier': True,
 
980
                    'property_account_payable':  account.search([('code','=','30010')])[0],
 
981
                    'property_account_receivable': account.search([('code','=','12010')])[0],
 
982
                    'city': 'XXX',
 
983
                })
 
984
 
965
985
    def test_99_create_esc(self):
966
986
        account = self.db.get('account.account')
967
987
        self.db.get('res.partner').create({
975
995
                'city': 'XXX',
976
996
        })
977
997
 
 
998
 
978
999
# Replicable class to create coordo n
979
1000
class coordon_creation(client_creation):
980
1001
    name_format = "%(db)s_HQ%(pind)dC%(ind)d"