changeset 4184433fa86f in modules/stock_supply:6.2
details: 
https://hg.tryton.org/modules/stock_supply?cmd=changeset&node=4184433fa86f
description:
        Do not minimize the supply dates interval

        Since we use a configured supply period, we do not have to minimize the
        interval on which to compute the supply.

        issue11318
        review366931003
        (grafted from e78dd7305c95c6b752342ee4aba8ec3406b1ef19)
diffstat:

 purchase_request.py |  8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diffs (25 lines):

diff -r bd69d4466769 -r 4184433fa86f purchase_request.py
--- a/purchase_request.py       Mon Nov 01 17:29:41 2021 +0100
+++ b/purchase_request.py       Sat Mar 26 12:02:32 2022 +0100
@@ -213,7 +213,7 @@
     @classmethod
     def get_supply_dates(cls, product, **pattern):
         """
-        Return the minimal interval of earliest supply dates for a product.
+        Return the interval of earliest supply dates for a product.
         """
         Date = Pool().get('ir.date')
 
@@ -228,11 +228,7 @@
                 date=next_day)
             if (not min_date) or supply_date < min_date:
                 min_date = supply_date
-            if (not max_date):
-                max_date = next_supply_date
-            if supply_date > min_date and supply_date < max_date:
-                max_date = supply_date
-            if next_supply_date < max_date:
+            if (not max_date) or next_supply_date > max_date:
                 max_date = next_supply_date
 
         if not min_date:

Reply via email to