diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js index a05139a27f9..c51892e0c71 100644 --- a/erpnext/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -44,29 +44,6 @@ erpnext.LeadController = frappe.ui.form.Controller.extend({ } }, - make_address_list: function() { - var me = this; - if(!this.frm.address_list) { - this.frm.address_list = new frappe.ui.Listing({ - parent: this.frm.fields_dict['address_html'].wrapper, - page_length: 5, - new_doctype: "Address", - get_query: function() { - return 'select name, address_type, address_line1, address_line2, \ - city, state, country, pincode, fax, email_id, phone, \ - is_primary_address, is_shipping_address from tabAddress \ - where lead="'+me.frm.doc.name+'" and docstatus != 2 \ - order by is_primary_address, is_shipping_address desc' - }, - as_dict: 1, - no_results_message: __('No addresses created'), - render_row: this.render_address_row, - }); - // note: render_address_row is defined in contact_control.js - } - this.frm.address_list.run(); - }, - create_customer: function() { frappe.model.open_mapped_doc({ method: "erpnext.selling.doctype.lead.lead.make_customer", diff --git a/erpnext/utilities/doctype/address/address.js b/erpnext/utilities/doctype/address/address.js index ad9abc92333..037f66306e3 100644 --- a/erpnext/utilities/doctype/address/address.js +++ b/erpnext/utilities/doctype/address/address.js @@ -5,7 +5,7 @@ frappe.ui.form.on("Address", "validate", function(frm) { // clear linked customer / supplier / sales partner on saving... - $.each(["Customer", "Supplier", "Sales Partner"], function(i, doctype) { + $.each(["Customer", "Supplier", "Sales Partner", "Lead"], function(i, doctype) { var name = frm.doc[doctype.toLowerCase().replace(/ /g, "_")]; if(name && locals[doctype] && locals[doctype][name]) frappe.model.remove_from_locals(doctype, name);