Use product_suppliers_used to find supplier on template

issue10129
review332171005
This commit is contained in:
Cédric Krier
2021-03-11 19:15:20 +01:00
parent a03c7d5c78
commit 38e115a05e
+3 -4
View File
@@ -168,10 +168,9 @@ class Move(metaclass=PoolMeta):
with Transaction().set_context(
supplier=self.from_location.consignment_party.id):
pattern = ProductSupplier.get_pattern()
for product_supplier in self.product.product_suppliers:
if product_supplier.match(pattern):
currency = product_supplier.currency
break
for product_supplier in self.product.product_suppliers_used(**pattern):
currency = product_supplier.currency
break
else:
currency = self.company.currency