From 188a499f45b59ad5b5a38b3db4c3cd1c22809a9a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 7 Feb 2012 14:28:05 +0530 Subject: [PATCH] Fix in default customer group fetch while converting lead to customer --- erpnext/selling/doctype/customer/customer.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 23d007b50fe..7e689dd7e63 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -12,7 +12,17 @@ cur_frm.cscript.onload = function(doc,dt,dn){ } // make address, contact, shipping, history list body cur_frm.cscript.make_hl_body(); - //cur_frm.cscript.make_sl_body(); + //cur_frm.cscript.make_sl_body(); + + cur_frm.cscript.load_defaults(doc, dt, dn); +} + +cur_frm.cscript.load_defaults = function(doc, dt, dn) { + doc = locals[doc.doctype][doc.name]; + if(!(doc.__islocal && doc.lead_name)) { return; } + + var fields_to_refresh = LocalDB.set_default_values(doc); + if(fields_to_refresh) { refresh_many(fields_to_refresh); } } cur_frm.add_fetch('lead_name', 'company_name', 'customer_name');