From a9fefa1988ce25d79b3f16e40fe81fe4e530d155 Mon Sep 17 00:00:00 2001 From: "Dylan Kiss (dyki)" Date: Thu, 19 Jan 2023 14:18:09 +0000 Subject: [PATCH] [FIX] account: support inherited CoA in tax update script For companies having a Chart of Accounts that inherits from an ancestor CoA linked to the taxes, the current tax update script did not work. This change also supports this case. X-original-commit: 45aae69c20d40467d64af4c7e4f0b45b7832b89c Part-of: odoo/odoo#110841 --- addons/account/models/chart_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 3a4c9117e44..6810b94a3a6 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -157,8 +157,8 @@ def update_taxes_from_templates(cr, chart_template_xmlid): ) env = api.Environment(cr, SUPERUSER_ID, {}) - chart_template_id = env['ir.model.data']._xmlid_to_res_id(chart_template_xmlid) - companies = env['res.company'].search([('chart_template_id', '=', chart_template_id)]) + chart_template_id = env.ref(chart_template_xmlid).id + companies = env['res.company'].search([('chart_template_id', 'child_of', chart_template_id)]) outdated_taxes = [] new_taxes_template = [] for company in companies: