Select the first supplier when all suppliers have the same maximum supply date
Since all suppliers have the same supply delay, the order must be used for selection. Closes #14939 (grafted from c4f986450d75ba8211ea9e3523de8d3b01f908b0) --HG-- branch : 8.0
This commit is contained in:
@@ -311,7 +311,9 @@ class PurchaseRequest(ModelSQL, ModelView, ChatMixin):
|
||||
timedelta = date - supply_date
|
||||
if timedelta >= datetime.timedelta(0):
|
||||
return product_supplier
|
||||
if supply_date < earlier_date or earlier_date is datetime.date.max:
|
||||
if (supply_date < earlier_date
|
||||
or (earlier_date is datetime.date.max
|
||||
and fastest is None)):
|
||||
earlier_date, fastest = supply_date, product_supplier
|
||||
return fastest
|
||||
|
||||
|
||||
Reference in New Issue
Block a user