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 9698bd8eb49..d541c5e19ea 100644 --- a/erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py +++ b/erpnext/manufacturing/doctype/master_production_schedule/master_production_schedule.py @@ -292,7 +292,7 @@ class MasterProductionSchedule(Document): return item_wise_data def add_mps_data(self, data): - data = frappe._dict(sorted(data.items(), key=lambda x: x[0][1])) + data = frappe._dict(sorted(data.items(), key=lambda x: x[0][1] or "")) for key in data: row = data[key]