19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:28 +01:00
parent ff721d030e
commit 7721452493
1826 changed files with 124775 additions and 274114 deletions

View file

@ -1,13 +1,12 @@
# 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):
env = api.Environment(cr, SUPERUSER_ID, {})
# We had corrupted data, handle the correction so the tax update can proceed.
# See https://github.com/odoo/odoo/commit/7b07df873535446f97abc1de9176b9332de5cb07
for company in env.companies:
for company in env['res.company'].search([('chart_template', '=', 'ch')], order="parent_path"):
# We had corrupted data, handle the correction so the tax update can proceed.
# See https://github.com/odoo/odoo/commit/7b07df873535446f97abc1de9176b9332de5cb07
taxes_to_check = (f'{company.id}_vat_purchase_81_reverse', f'{company.id}_vat_77_purchase_reverse')
tax_ids = env['ir.model.data'].search([
('name', 'in', taxes_to_check),
@ -19,5 +18,4 @@ def migrate(cr, version):
# set the child to it's parent's value
child.type_tax_use = tax.type_tax_use
# Update taxes
update_taxes_from_templates(cr, 'l10n_ch.l10nch_chart_template')
env['account.chart.template'].try_loading('ch', company, force_create=False)