From b664488d9847f838544a9258667cec701a27c081 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Sat, 20 Jan 2018 03:12:45 +0530 Subject: [PATCH] [Fix] Clears off the read-only fields in 'Primary Address and Contact Details' Section on blank link fields --- erpnext/selling/doctype/customer/customer.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 54f974cc20..0f8602a9be 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -42,6 +42,17 @@ frappe.ui.form.on("Customer", { } }) }, + customer_primary_address: function(frm){ + if(!frm.doc.customer_primary_address){ + frm.doc.primary_address = "" + } + }, + customer_primary_contact: function(frm){ + if(!frm.doc.customer_primary_contact){ + frm.doc.mobile_no = ""; + frm.doc.email_id = ""; + } + }, refresh: function(frm) { if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {