diff --git a/stock.py b/stock.py index 12140f8c68..3db62ae854 100644 --- a/stock.py +++ b/stock.py @@ -186,19 +186,19 @@ class Move(metaclass=PoolMeta): line.stock_moves = [self] line.origin = self - taxes = [] + taxes = set() pattern = self._get_tax_rule_pattern() for tax in line.product.supplier_taxes_used: if line.party.supplier_tax_rule: tax_ids = line.party.supplier_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 line.party.supplier_tax_rule: tax_ids = line.party.supplier_tax_rule.apply(None, pattern) if tax_ids: - taxes.extend(tax_ids) + taxes.update(tax_ids) line.taxes = taxes with Transaction().set_context( @@ -231,19 +231,19 @@ class Move(metaclass=PoolMeta): line.stock_moves = [self] line.origin = self - taxes = [] + taxes = set() pattern = self._get_tax_rule_pattern() for tax in line.product.customer_taxes_used: if line.party.customer_tax_rule: tax_ids = line.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 line.party.customer_tax_rule: tax_ids = line.party.customer_tax_rule.apply(None, pattern) if tax_ids: - taxes.extend(tax_ids) + taxes.update(tax_ids) line.taxes = taxes with Transaction().set_context(