diff --git a/erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py b/erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py index 906a329acca..5cc9f2c7b6e 100644 --- a/erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py +++ b/erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py @@ -224,6 +224,9 @@ class MasterProductionSchedule(Document): if ignore_orders: names = [name for name in names if name not in ignore_orders] + if not names: + return [] + query = query.where(doctype.parent.isin(names)) return query.run(as_dict=True)