From 468fb97c81694ca9fb11e3a56dbe0d99042a23a6 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 8 Aug 2017 17:27:58 +0530 Subject: [PATCH] [Fix] Lead address not able to select on the quotation (#10328) --- erpnext/selling/doctype/quotation/quotation.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index b90f725bb2..c149742fe3 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -9,6 +9,15 @@ frappe.ui.form.on('Quotation', { frm.custom_make_buttons = { 'Sales Order': 'Make Sales Order' } + }, + refresh: function(frm) { + frm.trigger("set_label"); + }, + quotation_to: function(frm) { + frm.trigger("set_label"); + }, + set_label: function(frm) { + frm.fields_dict.customer_address.set_label(__(frm.doc.quotation_to + " Address")); } }); @@ -24,6 +33,8 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ }, refresh: function(doc, dt, dn) { this._super(doc, dt, dn); + doctype = doc.quotation_to == 'Customer' ? 'Customer':'Lead'; + frappe.dynamic_link = {doc: this.frm.doc, fieldname: doctype.toLowerCase(), doctype: doctype} var me = this;