From 8090ea5c66eaf9f076193aa4af7f9dc503df44b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 26 Mar 2022 12:02:32 +0100 Subject: [PATCH] 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 --- purchase_request.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/purchase_request.py b/purchase_request.py index 7a22709924..bcb5d913e0 100644 --- a/purchase_request.py +++ b/purchase_request.py @@ -213,7 +213,7 @@ class PurchaseRequest(metaclass=PoolMeta): @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 @@ class PurchaseRequest(metaclass=PoolMeta): 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: