From eba3a8e8025ce2d0690fecea743b9cb202e7cd24 Mon Sep 17 00:00:00 2001 From: Himanshu Date: Fri, 11 Oct 2019 10:43:24 +0530 Subject: [PATCH] fix: get contact details (#19281) --- erpnext/crm/doctype/opportunity/opportunity.js | 4 ++++ erpnext/selling/doctype/quotation/quotation.js | 3 +++ 2 files changed, 7 insertions(+) diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index ec1762985b5..6e4d3ede4bc 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -100,6 +100,10 @@ frappe.ui.form.on("Opportunity", { }); } } + + if (frm.doc.opportunity_from && frm.doc.party_name && !frm.doc.contact_person) { + frm.trigger("party_name"); + } }, set_contact_link: function(frm) { diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 12f32602f5a..fb5336b3761 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -23,6 +23,9 @@ frappe.ui.form.on('Quotation', { refresh: function(frm) { frm.trigger("set_label"); frm.trigger("set_dynamic_field_label"); + if (frm.doc.quotation_to && frm.doc.party_name && !frm.doc.contact_person) { + frm.trigger("party_name"); + } }, quotation_to: function(frm) {