Skip to content
Snippets Groups Projects
Commit c8ea9f9f authored by Claire Bretton (clbr)'s avatar Claire Bretton (clbr)
Browse files

[FIX] account, l10n_ch: enable new taxes after module update


Swiss taxes retrieved by module update (and the update of taxes it triggers)
need to be active, even if the template data was set to inactive.

closes odoo/odoo#113001

Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
parent eb86c0b3
No related branches found
No related tags found
No related merge requests found
...@@ -212,6 +212,7 @@ def update_taxes_from_templates(cr, chart_template_xmlid): ...@@ -212,6 +212,7 @@ def update_taxes_from_templates(cr, chart_template_xmlid):
_notify_accountant_managers(outdated_taxes) _notify_accountant_managers(outdated_taxes)
if hasattr(chart_template, 'spoken_languages') and chart_template.spoken_languages: if hasattr(chart_template, 'spoken_languages') and chart_template.spoken_languages:
_process_taxes_translations(chart_template, new_template2tax) _process_taxes_translations(chart_template, new_template2tax)
return new_template2tax
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Account Templates: Account, Tax, Tax Code and chart. + Wizard # Account Templates: Account, Tax, Tax Code and chart. + Wizard
......
# Part of Odoo. See LICENSE file for full copyright and licensing details. # 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 from odoo.addons.account.models.chart_template import update_taxes_from_templates
def migrate(cr, version): 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment