From 10d634b016660be12a648c9e758801adb7cffe09 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 14 Jan 2016 10:34:18 +0530 Subject: [PATCH] [fix] set sales partner from previous document, fixes #4611 --- erpnext/controllers/js/contact_address_common.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/js/contact_address_common.js b/erpnext/controllers/js/contact_address_common.js index df3323fed7..c51ff468c3 100644 --- a/erpnext/controllers/js/contact_address_common.js +++ b/erpnext/controllers/js/contact_address_common.js @@ -33,7 +33,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.set_value("address_title", cur_frm.doc.customer_name); } } - if(["Supplier", "Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"] + else if(["Supplier", "Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"] .indexOf(doctype)!==-1) { var refdoc = frappe.get_doc(doctype, docname); cur_frm.set_value("supplier", refdoc.supplier || refdoc.name); @@ -41,7 +41,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { if(cur_frm.doc.doctype==="Address") cur_frm.set_value("address_title", cur_frm.doc.supplier_name); } - if(["Lead", "Opportunity", "Quotation"] + else if(["Lead", "Opportunity", "Quotation"] .indexOf(doctype)!==-1) { var refdoc = frappe.get_doc(doctype, docname); @@ -53,6 +53,9 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.set_value("address_title", cur_frm.doc.lead_name); } } + else if(doctype == "Sales Partner") { + cur_frm.set_value("sales_partner", docname); + } } } }