From f740f590f45dc2a23c6ebecc2d6b5f8ecf311dce Mon Sep 17 00:00:00 2001 From: Atul Patel Date: Tue, 29 Aug 2023 05:22:57 +0000 Subject: [PATCH] [FIX] l10n_tr: remove deprecated chart template method ref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As rewrite the whole chart template mechanism, From here: https://github.com/odoo/odoo/commit/512574861691f425ec6a17f20fe4b586bb88a299 we need to remove chart template reference from localization module. some of them are remaining. so removed from Turkey, Turkey localization in migration script otherwise we got this error: ``` File "/home/odoo/src/odoo/saas-16.3/addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py", line 2, in from odoo.addons.account.models.chart_template import update_taxes_from_templates ImportError: cannot import name 'update_taxes_from_templates' from 'odoo.addons.account.models.chart_template' (/home/odoo/src/odoo/saas-16.3/addons/account/models/chart_template.py) ``` closes odoo/odoo#133463 X-original-commit: 57a32afb534f18022d632b03a39a316bce2817ab Signed-off-by: William André (wan) --- addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py b/addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py index 04c2b333399..6864675ecb7 100644 --- a/addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py +++ b/addons/l10n_tr/migrations/1.1/end-migrate_update_taxes.py @@ -1,6 +1,8 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo.addons.account.models.chart_template import update_taxes_from_templates +from odoo import api, SUPERUSER_ID def migrate(cr, version): - update_taxes_from_templates(cr, 'l10n_tr.l10n_tr_chart_template') + env = api.Environment(cr, SUPERUSER_ID, {}) + for company in env['res.company'].search([('chart_template', '=', 'tr')]): + env['account.chart.template'].try_loading('tr', company)