changeset d23014d401c0 in modules/sale_shipment_cost:6.0
details: 
https://hg.tryton.org/modules/sale_shipment_cost?cmd=changeset&node=d23014d401c0
description:
        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
diffstat:

 stock.py |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 06ac8ca0ce76 -r d23014d401c0 stock.py
--- a/stock.py  Wed Feb 16 23:50:10 2022 +0100
+++ b/stock.py  Sun Jul 17 00:02:22 2022 +0200
@@ -184,19 +184,19 @@
         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

Reply via email to