From f272d32f80a0672199570aafc211d802a2329805 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 20 May 2026 00:37:14 +0530 Subject: [PATCH] fix: handle None delivery_date when sorting MPS data (backport #55028) (#55059) Co-authored-by: Nabin Hait fix: handle None delivery_date when sorting MPS data (#55028) --- .../master_production_schedule/master_production_schedule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]