[IMP] l10n_multilang: revert previous change and move it to l10n_multilang, the accou...
authorMartin Trigaux <mat@openerp.com>
Thu, 31 Oct 2013 10:44:01 +0000 (11:44 +0100)
committerMartin Trigaux <mat@openerp.com>
Thu, 31 Oct 2013 10:44:01 +0000 (11:44 +0100)
bzr revid: mat@openerp.com-20131031104401-9tgjzs3hohebtit0

addons/account/account.py
addons/l10n_multilang/l10n_multilang.py

index dfc16a9..7834fc6 100644 (file)
@@ -3445,10 +3445,6 @@ 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])
@@ -3469,10 +3465,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=ctx)
+        self._create_tax_templates_from_rates(cr, uid, obj_wizard, company_id, context=context)
 
         # 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=ctx)
+        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 as super user
         if obj_wizard.sale_tax and taxes_ref:
@@ -3481,7 +3477,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=ctx)
+        self._create_bank_journals_from_o2m(cr, uid, obj_wizard, company_id, acc_template_ref, context=context)
         return {}
 
     def _prepare_bank_journal(self, cr, uid, line, current_num, default_account_id, company_id, context=None):
index a44c9f8..1f09a7a 100644 (file)
@@ -79,7 +79,11 @@ class wizard_multi_charts_accounts(osv.osv_memory):
         return True
 
     def execute(self, cr, uid, ids, context=None):
-        res = super(wizard_multi_charts_accounts, self).execute(cr, uid, ids, context=context)
+        if not context:
+            context = {}
+        # remove the lang to get the untranslated value
+        ctx = dict(context, lang=None)
+        res = super(wizard_multi_charts_accounts, self).execute(cr, uid, ids, context=ctx)
 
         obj_multi = self.browse(cr, uid, ids[0], context=context)
         company_id = obj_multi.company_id.id