diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index f9512cd4e83..dee402d7f5d 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -177,7 +177,7 @@ 1103 - Output VAT + Tax Paid other @@ -210,7 +210,7 @@ 1112 - Input VAT + Tax Received other @@ -308,55 +308,55 @@ - Input TAX + Tax Received - Input TAX Rate S (15%) + Tax Received Rate S (15%) - Input TAX Rate R (5%) + Tax Received Rate R (5%) - Input TAX Rate X (Exempt) + Tax Received Rate X (Exempt) - Input TAX Rate O (Out of scope) + Tax Received Rate O (Out of scope) - Output TAX + Tax Paid - Output TAX Rate S (15%) + Tax Paid Rate S (15%) - Output TAX Rate R (5%) + Tax Paid Rate R (5%) - Output TAX Rate X (Exempt) + Tax Paid Rate X (Exempt) - Output TAX Rate O (Out of scope) + Tax Paid Rate O (Out of scope) diff --git a/addons/account/installer.py b/addons/account/installer.py index 54ef92b8fb9..f56aadd3d17 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -495,6 +495,8 @@ class account_installer(osv.osv_memory): sal_tax_parent_id = mod_obj.read(cr, uid, [sal_tax_parent], ['res_id'])[0]['res_id'] if s_tax*100 > 0.0: + tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Received')], context=context) + sales_tax_account_id = tax_account_ids and tax_account_ids[0] or False vals_tax_code = { 'name': 'TAX%s%%'%(s_tax*100), 'code': 'TAX%s%%'%(s_tax*100), @@ -509,11 +511,18 @@ class account_installer(osv.osv_memory): 'amount':s_tax, 'base_code_id':new_tax_code, 'tax_code_id':new_tax_code, - 'type_tax_use':'sale' + 'type_tax_use':'sale', + 'account_collected_id':sales_tax_account_id, + 'account_paid_id':sales_tax_account_id }) + default_account_ids = obj_acc.search(cr, uid, [('name','=','Product Sales')],context=context) + if default_account_ids: + obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[sales_tax])]}) tax_val.update({'taxes_id':[(6,0,[sales_tax])]}) default_tax.append(('taxes_id',sales_tax)) if p_tax*100 > 0.0: + tax_account_ids = obj_acc.search(cr, uid, [('name','=','Tax Paid')], context=context) + purchase_tax_account_id = tax_account_ids and tax_account_ids[0] or False vals_tax_code = { 'name': 'TAX%s%%'%(p_tax*100), 'code': 'TAX%s%%'%(p_tax*100), @@ -528,8 +537,13 @@ class account_installer(osv.osv_memory): 'amount':p_tax, 'base_code_id':new_tax_code, 'tax_code_id':new_tax_code, - 'type_tax_use':'purchase' + 'type_tax_use':'purchase', + 'account_collected_id':purchase_tax_account_id, + 'account_paid_id':purchase_tax_account_id }) + default_account_ids = obj_acc.search(cr, uid, [('name','=','Expenses')], context=context) + if default_account_ids: + obj_acc.write(cr, uid, default_account_ids, {'tax_ids':[(6,0,[purchase_tax])]}) tax_val.update({'supplier_taxes_id':[(6,0,[purchase_tax])]}) default_tax.append(('supplier_taxes_id',purchase_tax)) if len(tax_val):