[FIX] l10n_lu: fix the migration script

The migration script for taxes was forward-ported without changes from 15.0 to master. However, it should be done differently since saas-16.2.

closes odoo/odoo#145338

X-original-commit: d5179bf65294bced57877579c56deb9e72ecb177
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
This commit is contained in:
aliya
2023-12-06 21:48:56 +00:00
parent 6e8e3e6333
commit 5d00b4146a
2 changed files with 7 additions and 6 deletions
@@ -1,6 +0,0 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.models.chart_template import update_taxes_from_templates
def migrate(cr, version):
update_taxes_from_templates(cr, 'l10n_lu.lu_2011_chart_1')
@@ -0,0 +1,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
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', '=', 'lu')]):
env['account.chart.template'].try_loading('lu', company)