From b2465a48bbcf29c21d5bd830276fdffdcd403ecb Mon Sep 17 00:00:00 2001 From: oco-odoo Date: Mon, 9 Dec 2019 12:46:57 +0000 Subject: [PATCH] [FIX] account: don't delete the tags on taxes when upgrading a tax report Before that, upgrading a l10n_* module with a tax report removed all the tags from the tax repartition lines. X-original-commit: a1364bde860266154298034bbae3693161834f49 --- addons/account/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 2d684ff14c2..ccb0646e009 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -84,7 +84,7 @@ class AccountTaxReport(models.Model): if 'country_id' in vals: tags_cache = {} - for record in self: + for record in self.filtered(lambda x: x.country_id.id != vals['country_id']): for line in record.line_ids: if line.tag_ids: #The tags for this country may have been created by a previous line in this loop