From 59e5afef57f7c2526341e5d237d342a8fb07d8cf Mon Sep 17 00:00:00 2001 From: guva-odoo Date: Mon, 12 Feb 2024 10:37:22 +0100 Subject: [PATCH] [FIX] account: clear repartition line on tax update In case of tax update, tags were remaining even if user deleted them. This is because we don't clear the repartition lines before reassign them in `_pre_reload_data()` Part-of: odoo/odoo#153558 --- addons/account/models/chart_template.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 37adeeef7c8..e3325b06755 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -302,8 +302,7 @@ class AccountChartTemplate(models.AbstractModel): for _c, _id, repartition_line in values.get('repartition_line_ids', []): tags = repartition_line.get('tag_ids') repartition_line.clear() - if tags: - repartition_line['tag_ids'] = tags + repartition_line['tag_ids'] = tags or [Command.clear()] elif model_name == 'account.account': # Point or create xmlid to existing record to avoid duplicate code account = self.ref(xmlid, raise_if_not_found=False)