From ce066019ff82d9c2c00f8bd88027852de4cf2152 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Wed, 29 Nov 2017 12:28:20 +0530 Subject: [PATCH] [Fix] Trigger dirty when checkbox value is changed (#4541) * trigger save on uncheck * Update form.js the reason for this condition was text editor --- frappe/public/js/legacy/form.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/legacy/form.js b/frappe/public/js/legacy/form.js index 6710e04d19..5c64d62c0a 100644 --- a/frappe/public/js/legacy/form.js +++ b/frappe/public/js/legacy/form.js @@ -195,9 +195,10 @@ _f.Frm.prototype.watch_model_updates = function() { frappe.model.on(me.doctype, "*", function(fieldname, value, doc) { // set input if(doc.name===me.docname) { - if (!value && !doc[value]) { + if ((value==='' || value===null) && !doc[value]) { // both the incoming and outgoing values are falsy - // so don't trigger dirty + // the texteditor, summernote, changes nulls to empty strings on render, + // so ignore those changes } else { me.dirty(); }