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) {