From 0fb11f25c455908664023effdff8fa571de58ad9 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Tue, 28 Aug 2012 11:53:45 +0200 Subject: [PATCH] [FIX] account: when generating objects from templates, set the default taxes as a super user + use of set_default() instead of deprecated set(key='default') (on ir.values) bzr revid: qdp-launchpad@openerp.com-20120828095345-erwdm59r3wspqbah --- addons/account/account.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 907e6207380..5a61f73b6c1 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3345,13 +3345,11 @@ class wizard_multi_charts_accounts(osv.osv_memory): # Install all the templates objects and generate the real objects acc_template_ref, taxes_ref, tax_code_ref = self._install_template(cr, uid, obj_wizard.chart_template_id.id, company_id, code_digits=obj_wizard.code_digits, obj_wizard=obj_wizard, context=context) - # write values of default taxes for product + # write values of default taxes for product as super user if obj_wizard.sale_tax and taxes_ref: - ir_values_obj.set(cr, uid, key='default', key2=False, name="taxes_id", company=company_id, - models =[('product.product',False)], value=[taxes_ref[obj_wizard.sale_tax.id]]) + ir_values_obj.set_default(cr, 1, 'product.product', "taxes_id", [taxes_ref[obj_wizard.sale_tax.id]], for_all_users=True, company=company_id) if obj_wizard.purchase_tax and taxes_ref: - ir_values_obj.set(cr, uid, key='default', key2=False, name="supplier_taxes_id", company=company_id, - models =[('product.product',False)], value=[taxes_ref[obj_wizard.purchase_tax.id]]) + ir_values_obj.set_default(cr, 1, 'product.product', "supplier_taxes_id", [taxes_ref[obj_wizard.purchase_tax.id]], for_all_users=True, company=company_id) # Create Bank journals self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=context)