From a1d7646e70e2337290f1771bed3f26f78db2c202 Mon Sep 17 00:00:00 2001 From: shreyas Date: Fri, 7 Oct 2016 12:58:58 +0530 Subject: [PATCH 1/2] [Fix] Allow user to save Notification Control without selecting transaction --- .../doctype/notification_control/notification_control.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js index c8e199bf46..9a1f238096 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.js +++ b/erpnext/setup/doctype/notification_control/notification_control.js @@ -9,7 +9,9 @@ frappe.ui.form.on("Notification Control", { frm.set_value("custom_message", frm.doc[frm.events.get_fieldname(frm)]); }, set_message: function(frm) { - frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message); + if(frm.doc.select_transaction) { + frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message); + } frm.save(); }, get_fieldname: function(frm) { From c1b71041263b1375caa4d805d4589431b85a7e9f Mon Sep 17 00:00:00 2001 From: shreyas Date: Fri, 7 Oct 2016 14:20:51 +0530 Subject: [PATCH 2/2] [Fix] Minor changes to logic --- .../setup/doctype/notification_control/notification_control.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js index 9a1f238096..70d45bcba3 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.js +++ b/erpnext/setup/doctype/notification_control/notification_control.js @@ -9,7 +9,7 @@ frappe.ui.form.on("Notification Control", { frm.set_value("custom_message", frm.doc[frm.events.get_fieldname(frm)]); }, set_message: function(frm) { - if(frm.doc.select_transaction) { + if(frm.doc.select_transaction && frm.doc.select_transaction !== " ") { frm.set_value(frm.events.get_fieldname(frm), frm.doc.custom_message); } frm.save();