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:
rohitwaghchaure 2021-05-06 14:04:14 +05:30 committed by GitHub
commit 7ed531611b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -838,9 +838,10 @@ class BuyingController(StockController):
if not self.get("items"):
return
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
if earliest_schedule_date:
self.schedule_date = earliest_schedule_date
if any(d.schedule_date for d in self.get("items")):
# Select 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:
for d in self.get('items'):