From 38e115a05ee76c7a9034b9ba5d4a24daee0bed3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 11 Mar 2021 19:15:20 +0100 Subject: [PATCH] Use product_suppliers_used to find supplier on template issue10129 review332171005 --- stock.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stock.py b/stock.py index e79aff4881..0d8d305c42 100644 --- a/stock.py +++ b/stock.py @@ -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