[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
This commit is contained in:
guva-odoo
2024-02-13 08:30:16 +00:00
parent c5e380fc56
commit 59e5afef57
+1 -2
View File
@@ -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)