From 0948358bb3fe62053ff4fcac285ab7f5743465ea Mon Sep 17 00:00:00 2001 From: Rehan Ansari Date: Mon, 6 Oct 2025 01:29:54 +0530 Subject: [PATCH] fix: prevent empty Create dropdown when In Process --- .../doctype/production_plan/production_plan.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_plan/production_plan.js b/erpnext/manufacturing/doctype/production_plan/production_plan.js index 9a39b3af84b..4517314748f 100644 --- a/erpnext/manufacturing/doctype/production_plan/production_plan.js +++ b/erpnext/manufacturing/doctype/production_plan/production_plan.js @@ -115,6 +115,8 @@ frappe.ui.form.on("Production Plan", { __("View") ); + let has_create_buttons = false; + if (frm.doc.status !== "Completed") { if (frm.doc.status === "Closed") { frm.add_custom_button( @@ -144,6 +146,7 @@ frappe.ui.form.on("Production Plan", { }, __("Create") ); + has_create_buttons = true; } if ( @@ -158,10 +161,11 @@ frappe.ui.form.on("Production Plan", { }, __("Create") ); + has_create_buttons = true; } } - if (frm.doc.status !== "Closed") { + if (has_create_buttons && frm.doc.status !== "Closed") { frm.page.set_inner_btn_group_as_primary(__("Create")); } }