From 7a495bc4ce8a47030698b3d647ff608ed7679b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 17 Jul 2022 00:02:22 +0200 Subject: [PATCH] Ensure unique taxes when applying tax rule Since issue10841 the taxes must be unique so the tax rule application must result on unique taxes. issue11230 review415271003 --HG-- branch : 6.0 --- stock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stock.py b/stock.py index 498fe7900b..38fb34d564 100644 --- a/stock.py +++ b/stock.py @@ -184,19 +184,19 @@ class ShipmentOut(metaclass=PoolMeta): invoice_line.currency = invoice.currency invoice_line.company = invoice.company - taxes = [] + taxes = set() pattern = self._get_cost_tax_rule_pattern() for tax in product.customer_taxes_used: if party.customer_tax_rule: tax_ids = party.customer_tax_rule.apply(tax, pattern) if tax_ids: - taxes.extend(tax_ids) + taxes.update(tax_ids) continue - taxes.append(tax.id) + taxes.add(tax.id) if party.customer_tax_rule: tax_ids = party.customer_tax_rule.apply(None, pattern) if tax_ids: - taxes.extend(tax_ids) + taxes.update(tax_ids) invoice_line.taxes = taxes invoice_line.account = product.account_revenue_used