diff --git a/addons/account/configurable_account_chart.xml b/addons/account/configurable_account_chart.xml index a6b271bedcb..658cf2907af 100644 --- a/addons/account/configurable_account_chart.xml +++ b/addons/account/configurable_account_chart.xml @@ -154,7 +154,7 @@ 1104 Bank Current Account - other + view @@ -162,7 +162,7 @@ 1105 Cash - other + view diff --git a/addons/account/installer.py b/addons/account/installer.py index 81993908be9..de557cd51a0 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -32,6 +32,11 @@ class account_installer(osv.osv_memory): _name = 'account.installer' _inherit = 'res.config.installer' + def _get_default_accounts(self, cr, uid, context=None): + accounts = [{'acc_name':'Current','account_type':'cash'}, + {'acc_name':'Deposit','account_type':'cash'}] + return accounts + def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') ids = modules.search(cr, uid, [('category_id','=','Account Charts')]) @@ -77,6 +82,7 @@ class account_installer(osv.osv_memory): 'sale_tax':lambda *a:0.0, 'purchase_tax':lambda *a:0.0, 'charts':'configurable', + 'bank_accounts_id':_get_default_accounts } def on_change_start_date(self, cr, uid, id, start_date): @@ -390,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() @@ -401,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, @@ -414,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)) @@ -424,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, @@ -431,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)) diff --git a/addons/account/project/analytic_account_demo.xml b/addons/account/project/analytic_account_demo.xml index bb0738dbb65..98fcb8fa370 100644 --- a/addons/account/project/analytic_account_demo.xml +++ b/addons/account/project/analytic_account_demo.xml @@ -1,26 +1,35 @@ + + Analytic Chart + 0 + Leaves 1 + Internal 2 + Our Super Product 100 open + Project 1 101 + Project 2 102 + Training diff --git a/addons/base_setup/base_setup_data.xml b/addons/base_setup/base_setup_data.xml index 90d48de5eba..024accc77ce 100644 --- a/addons/base_setup/base_setup_data.xml +++ b/addons/base_setup/base_setup_data.xml @@ -7,23 +7,25 @@ form
- - - - - - - - - - -