diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index d275de7df54df577fe0e52f7321c7f0f93cac2da..03ef0d207644a9d56bf4b215a52a8072ee13b1d6 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -212,6 +212,7 @@ def update_taxes_from_templates(cr, chart_template_xmlid): _notify_accountant_managers(outdated_taxes) if hasattr(chart_template, 'spoken_languages') and chart_template.spoken_languages: _process_taxes_translations(chart_template, new_template2tax) + return new_template2tax # --------------------------------------------------------------- # Account Templates: Account, Tax, Tax Code and chart. + Wizard diff --git a/addons/l10n_ch/migrations/11.1/end-migrate_update_taxes.py b/addons/l10n_ch/migrations/11.1/end-migrate_update_taxes.py index 6f14580a5581464a3875105a28a602568fcaebdf..81d93b5b9af1d84296b29cde3afb5edcfc83068c 100644 --- a/addons/l10n_ch/migrations/11.1/end-migrate_update_taxes.py +++ b/addons/l10n_ch/migrations/11.1/end-migrate_update_taxes.py @@ -1,6 +1,10 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. +from odoo import api, SUPERUSER_ID from odoo.addons.account.models.chart_template import update_taxes_from_templates def migrate(cr, version): - update_taxes_from_templates(cr, 'l10n_ch.l10nch_chart_template') + new_template_to_tax = update_taxes_from_templates(cr, 'l10n_ch.l10nch_chart_template') + _, new_tax_ids = zip(*new_template_to_tax) + env = api.Environment(cr, SUPERUSER_ID, {}) + env['account.tax'].browse(new_tax_ids).active = True