diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index e3165b07cea..0ec7c84ae97 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -276,6 +276,8 @@ class AccountChartTemplate(models.AbstractModel): elif model_name == 'account.tax': # Only update the tags of existing taxes if xmlid not in xmlid2tax or tax_template_changed(xmlid2tax[xmlid], values): + if self._context.get('force_new_tax_active'): + values['active'] = True if xmlid in xmlid2tax: obsolete_xmlid.add(xmlid) oldtax = xmlid2tax[xmlid] diff --git a/addons/l10n_ch/migrations/11.1/post-migrate_update_taxes.py b/addons/l10n_ch/migrations/11.1/post-migrate_update_taxes.py index 6b420315510..fb8c8112c91 100644 --- a/addons/l10n_ch/migrations/11.1/post-migrate_update_taxes.py +++ b/addons/l10n_ch/migrations/11.1/post-migrate_update_taxes.py @@ -5,4 +5,4 @@ from odoo import api, SUPERUSER_ID def migrate(cr, version): env = api.Environment(cr, SUPERUSER_ID, {}) for company in env['res.company'].search([('chart_template', '=', 'ch')]): - env['account.chart.template'].try_loading('ch', company) + env['account.chart.template'].with_context(force_new_tax_active=True).try_loading('ch', company)