changeset 03b90dd7b803 in modules/purchase_requisition:default
details:
https://hg.tryton.org/modules/purchase_requisition?cmd=changeset;node=03b90dd7b803
description:
Use a fresh product instance to find best product supplier
This ensure to be able to read all the product suppliers.
issue8723
review284231002
diffstat:
purchase.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diffs (25 lines):
diff -r 03daa8e9f401 -r 03b90dd7b803 purchase.py
--- a/purchase.py Thu Oct 10 10:04:39 2019 +0200
+++ b/purchase.py Thu Oct 24 19:08:07 2019 +0200
@@ -513,6 +513,11 @@
return self.unit.digits
return 2
+ def _get_purchase_request_product_supplier_pattern(self):
+ return {
+ 'company': self.requisition.company.id,
+ }
+
def compute_request(self):
"""
Return the value of the purchase request which will answer to
@@ -530,7 +535,8 @@
if not self.supplier and self.product:
supplier, purchase_date = Request.find_best_supplier(
- self.product, supply_date)
+ self.product, supply_date,
+ **self._get_purchase_request_product_supplier_pattern())
else:
supplier = self.supplier
# TODO compute purchase_date for product_supplier