[fix] check for null date fields (#11334)
This commit is contained in:
parent
6a4e230cde
commit
d6e67ce123
@ -17,6 +17,8 @@ def execute():
|
||||
doc = frappe.get_doc(doctype, record)
|
||||
if doc.items:
|
||||
if not doc.schedule_date:
|
||||
min_schedule_date = min([d.schedule_date for d in doc.items])
|
||||
frappe.db.set_value(doctype, record,
|
||||
"schedule_date", min_schedule_date, update_modified=False)
|
||||
schedule_dates = [d.schedule_date for d in doc.items if d.schedule_date]
|
||||
if len(schedule_dates) > 0:
|
||||
min_schedule_date = min(schedule_dates)
|
||||
frappe.db.set_value(doctype, record,
|
||||
"schedule_date", min_schedule_date, update_modified=False)
|
Loading…
Reference in New Issue
Block a user