diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py index e8472aafc2e..d58527e00cd 100644 --- a/erpnext/crm/doctype/lead/lead_dashboard.py +++ b/erpnext/crm/doctype/lead/lead_dashboard.py @@ -4,6 +4,10 @@ from frappe import _ def get_data(): return { 'fieldname': 'lead', + 'non_standard_fieldnames': { + 'Quotation': 'party_name', + 'Opportunity': 'party_name' + }, 'transactions': [ { 'items': ['Opportunity', 'Quotation'] diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js index 5869c4da4c2..6aad29183fc 100644 --- a/erpnext/public/js/utils/party.js +++ b/erpnext/public/js/utils/party.js @@ -8,9 +8,10 @@ erpnext.utils.get_party_details = function(frm, method, args, callback) { method = "erpnext.accounts.party.get_party_details"; } if(!args) { - if(frm.doctype != "Purchase Order" && frm.doc.customer) { + if((frm.doctype != "Purchase Order" && frm.doc.customer) + || (frm.doc.party_name && in_list(['Quotation', 'Opportunity'], frm.doc.doctype))) { args = { - party: frm.doc.customer, + party: frm.doc.customer || frm.doc.party_name, party_type: "Customer", price_list: frm.doc.selling_price_list }; diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index c6e5a58b912..5d4b8a0116f 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -42,6 +42,12 @@ erpnext.selling.QuotationController = erpnext.selling.SellingController.extend({ this._super(doc, dt, dn); }, + party_name: function() { + var me = this; + erpnext.utils.get_party_details(this.frm, null, null, function() { + me.apply_price_list(); + }); + }, refresh: function(doc, dt, dn) { this._super(doc, dt, dn); doctype = doc.quotation_to == 'Customer' ? 'Customer':'Lead'; diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 400e67c792f..4083b8e6d0b 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -169,8 +169,8 @@ "in_filter": 0, "in_global_search": 1, "in_list_view": 0, - "in_standard_filter": 1, - "label": "Customer/Lead", + "in_standard_filter": 0, + "label": "Party", "length": 0, "no_copy": 0, "oldfieldname": "customer", @@ -3224,7 +3224,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2019-05-07 12:42:51.125194", + "modified": "2019-05-07 14:29:22.565474", "modified_by": "Administrator", "module": "Selling", "name": "Quotation",