From ea212a166b68608b8816bb4f8a414eb2fbbb3565 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 31 Oct 2013 11:08:09 +0100 Subject: [PATCH] [FIX] account: generate the accounts based on templates with untranslated terms (so benefit from translation) bzr revid: mat@openerp.com-20131031100809-p0irwjbq3chxjsd9 --- addons/account/account.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 7834fc6ed1b..dfc16a93547 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -3445,6 +3445,10 @@ class wizard_multi_charts_accounts(osv.osv_memory): all the provided information to create the accounts, the banks, the journals, the taxes, the tax codes, the accounting properties... accordingly for the chosen company. ''' + if not context: + context = {} + # remove the lang to get the untranslated value + ctx = dict(context, lang=None) obj_data = self.pool.get('ir.model.data') ir_values_obj = self.pool.get('ir.values') obj_wizard = self.browse(cr, uid, ids[0]) @@ -3465,10 +3469,10 @@ class wizard_multi_charts_accounts(osv.osv_memory): pass # If the floats for sale/purchase rates have been filled, create templates from them - self._create_tax_templates_from_rates(cr, uid, obj_wizard, company_id, context=context) + self._create_tax_templates_from_rates(cr, uid, obj_wizard, company_id, context=ctx) # 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) + 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=ctx) # write values of default taxes for product as super user if obj_wizard.sale_tax and taxes_ref: @@ -3477,7 +3481,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): ir_values_obj.set_default(cr, SUPERUSER_ID, 'product.product', "supplier_taxes_id", [taxes_ref[obj_wizard.purchase_tax.id]], for_all_users=True, company_id=company_id) # Create Bank journals - self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=context) + self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=ctx) return {} def _prepare_bank_journal(self, cr, uid, line, current_num, default_account_id, company_id, context=None):