Merge pull request #25588 from 18alantom/fix-check-schedule-date
fix: check for None in item.schedule_date before setting
This commit is contained in:
commit
7ed531611b
@ -838,9 +838,10 @@ class BuyingController(StockController):
|
|||||||
if not self.get("items"):
|
if not self.get("items"):
|
||||||
return
|
return
|
||||||
|
|
||||||
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
|
if any(d.schedule_date for d in self.get("items")):
|
||||||
if earliest_schedule_date:
|
# Select earliest schedule_date.
|
||||||
self.schedule_date = earliest_schedule_date
|
self.schedule_date = min(d.schedule_date for d in self.get("items")
|
||||||
|
if d.schedule_date is not None)
|
||||||
|
|
||||||
if self.schedule_date:
|
if self.schedule_date:
|
||||||
for d in self.get('items'):
|
for d in self.get('items'):
|
||||||
|
Loading…
Reference in New Issue
Block a user