From 87560ec8ecbd221e103e10b8d991bf4bb113834f Mon Sep 17 00:00:00 2001 From: pro-odoo Date: Fri, 29 Sep 2017 16:35:47 +0200 Subject: [PATCH] [FIX] account: show default taxes in settings Upon generation of a CoA from templates, taxes are created by default (lowest sequence) but that wasn't reflected in the settings. Was PR#19802 --- addons/account/models/chart_template.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 1fc53b281bd..66dc46d7c3d 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -903,12 +903,15 @@ class WizardMultiChartsAccounts(models.TransientModel): # Install all the templates objects and generate the real objects acc_template_ref, taxes_ref = self.chart_template_id._install_template(company, code_digits=self.code_digits, transfer_account_id=self.transfer_account_id) - # write values of default taxes for product as super user + # write values of default taxes for product as super user and write in the config IrDefault = self.env['ir.default'] + IrConfig = self.env['ir.config_parameter'] if self.sale_tax_id and taxes_ref: IrDefault.sudo().set('product.template', "taxes_id", [taxes_ref[self.sale_tax_id.id]], company_id=company.id) + IrConfig.sudo().set_param("account.default_sale_tax_id", taxes_ref[self.sale_tax_id.id]) if self.purchase_tax_id and taxes_ref: IrDefault.sudo().set('product.template', "supplier_taxes_id", [taxes_ref[self.purchase_tax_id.id]], company_id=company.id) + IrConfig.sudo().set_param("account.default_purchase_tax_id", taxes_ref[self.purchase_tax_id.id]) # Create Bank journals self._create_bank_journals_from_o2m(company, acc_template_ref)