diff options
| author | nch@tinyerp.com <> | 2010-05-13 12:33:39 +0530 |
|---|---|---|
| committer | nch@tinyerp.com <> | 2010-05-13 12:33:39 +0530 |
| commit | e2f6088ea705d2ba61da0f3628af90bc438c178f (patch) | |
| tree | 8fed1671b4a505cc1f8ca095c2cb71643faa2862 /addons | |
| parent | cf6db2b9936906bd1a82c1107a706849b0823dfc (diff) | |
[IMP]:configurable acc & tax chart
bzr revid: nch@tinyerp.com-20100513070339-6l3dds3jpmvo4wu9
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/configurable_account_chart.xml | 2 | ||||
| -rw-r--r-- | addons/account/installer.py | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index 73cb4499e20..658cf2907af 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -162,7 +162,7 @@ <field name="code">1105</field> <field name="name">Cash</field> <field ref="conf_cas" name="parent_id"/> - <field name="type">other</field> + <field name="type">view</field> <field name="user_type" ref="conf_account_type_cash"/> </record> diff --git a/addons/account/installer.py b/addons/account/installer.py index 1cbed3cd2a7..de557cd51a0 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -396,6 +396,7 @@ class account_installer(osv.osv_memory): company_id = self.pool.get('res.users').browse(cr,uid,[uid],context)[0].company_id for res in self.read(cr,uid,ids): if record.charts == 'configurable': + mod_obj = self.pool.get('ir.model.data') fp = tools.file_open(opj('account','configurable_account_chart.xml')) tools.convert_xml_import(cr, 'account', fp, {}, 'init',True, None) fp.close() @@ -407,12 +408,20 @@ class account_installer(osv.osv_memory): p_tax = (res.get('purchase_tax',0.0))/100 tax_val = {} default_tax = [] + + pur_tax_parent = mod_obj._get_id(cr, uid, 'account', 'vat_code_base_purchases') + pur_tax_parent_id = mod_obj.read(cr, uid, [pur_tax_parent], ['res_id'])[0]['res_id'] + + sal_tax_parent = mod_obj._get_id(cr, uid, 'account', 'vat_code_base_sales') + sal_tax_parent_id = mod_obj.read(cr, uid, [sal_tax_parent], ['res_id'])[0]['res_id'] + if s_tax*100 > 0.0: vals_tax_code = { 'name': 'VAT%s%%'%(s_tax*100), 'code': 'VAT%s%%'%(s_tax*100), 'company_id': company_id.id, 'sign': 1, + 'parent_id':sal_tax_parent_id } new_tax_code = self.pool.get('account.tax.code').create(cr,uid,vals_tax_code) sales_tax = obj_tax.create(cr, uid, @@ -420,7 +429,8 @@ class account_installer(osv.osv_memory): 'description':'VAT%s%%'%(s_tax*100), 'amount':s_tax, 'base_code_id':new_tax_code, - 'tax_code_id':new_tax_code + 'tax_code_id':new_tax_code, + 'type_tax_use':'sale' }) tax_val.update({'taxes_id':[(6,0,[sales_tax])]}) default_tax.append(('taxes_id',sales_tax)) @@ -430,6 +440,7 @@ class account_installer(osv.osv_memory): 'code': 'VAT%s%%'%(p_tax*100), 'company_id': company_id.id, 'sign': 1, + 'parent_id':pur_tax_parent_id } new_tax_code = self.pool.get('account.tax.code').create(cr,uid,vals_tax_code) purchase_tax = obj_tax.create(cr, uid, @@ -437,7 +448,8 @@ class account_installer(osv.osv_memory): 'description':'VAT%s%%'%(p_tax*100), 'amount':p_tax, 'base_code_id':new_tax_code, - 'tax_code_id':new_tax_code + 'tax_code_id':new_tax_code, + 'type_tax_use':'purchase' }) tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]}) default_tax.append(('supplier_taxes_id',purchase_tax)) |
