changeset 53613abcdbb7 in modules/stock_supply:5.0
details: 
https://hg.tryton.org/modules/stock_supply?cmd=changeset&node=53613abcdbb7
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 374444b2afbc -r 53613abcdbb7 purchase_request.py
--- a/purchase_request.py       Wed Jul 21 08:27:45 2021 +0200
+++ b/purchase_request.py       Sat Mar 26 12:02:32 2022 +0100
@@ -214,7 +214,7 @@
     @classmethod
     def get_supply_dates(cls, product):
         """
-        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')
 
@@ -229,11 +229,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