diff --git a/erpnext/crm/doctype/lead/lead_dashboard.py b/erpnext/crm/doctype/lead/lead_dashboard.py index d58527e00cd..69d8ca70926 100644 --- a/erpnext/crm/doctype/lead/lead_dashboard.py +++ b/erpnext/crm/doctype/lead/lead_dashboard.py @@ -8,6 +8,9 @@ def get_data(): 'Quotation': 'party_name', 'Opportunity': 'party_name' }, + 'dynamic_links': { + 'party_name': ['Lead', 'quotation_to'] + }, 'transactions': [ { 'items': ['Opportunity', 'Quotation'] diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json index e3f43f40fd3..dc0d0bb6c2d 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.json +++ b/erpnext/crm/doctype/opportunity/opportunity.json @@ -136,7 +136,7 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 1, - "label": "Customer/Lead", + "label": "Party", "length": 0, "no_copy": 0, "oldfieldname": "customer", @@ -1468,7 +1468,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2019-04-25 18:55:43.874656", + "modified": "2019-05-11 19:22:33.533487", "modified_by": "Administrator", "module": "CRM", "name": "Opportunity", diff --git a/erpnext/crm/doctype/opportunity/opportunity_list.js b/erpnext/crm/doctype/opportunity/opportunity_list.js index 9712fb04c56..af53bf7fbf1 100644 --- a/erpnext/crm/doctype/opportunity/opportunity_list.js +++ b/erpnext/crm/doctype/opportunity/opportunity_list.js @@ -17,5 +17,13 @@ frappe.listview_settings['Opportunity'] = { listview.page.add_menu_item(__("Set as Closed"), function() { listview.call_for_selected_items(method, {"status": "Closed"}); }); + + listview.page.fields_dict.opportunity_from.get_query = function() { + return { + "filters": { + "name": ["in", ["Customer", "Lead"]], + } + }; + }; } }; diff --git a/erpnext/selling/doctype/customer/customer_dashboard.py b/erpnext/selling/doctype/customer/customer_dashboard.py index 6d6c86fbefd..075ad4eb60c 100644 --- a/erpnext/selling/doctype/customer/customer_dashboard.py +++ b/erpnext/selling/doctype/customer/customer_dashboard.py @@ -10,6 +10,9 @@ def get_data(): 'Quotation': 'party_name', 'Opportunity': 'party_name' }, + 'dynamic_links': { + 'party_name': ['Customer', 'quotation_to'] + }, 'transactions': [ { 'label': _('Pre Sales'), diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 4083b8e6d0b..33fc4dbeb04 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -133,7 +133,7 @@ "in_filter": 0, "in_global_search": 0, "in_list_view": 0, - "in_standard_filter": 0, + "in_standard_filter": 1, "label": "Quotation To", "length": 0, "no_copy": 0, @@ -169,7 +169,7 @@ "in_filter": 0, "in_global_search": 1, "in_list_view": 0, - "in_standard_filter": 0, + "in_standard_filter": 1, "label": "Party", "length": 0, "no_copy": 0, @@ -3224,7 +3224,7 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, - "modified": "2019-05-07 14:29:22.565474", + "modified": "2019-05-11 19:26:50.735628", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation/quotation_list.js b/erpnext/selling/doctype/quotation/quotation_list.js index 8baf9b2518c..61a8bc1cab3 100644 --- a/erpnext/selling/doctype/quotation/quotation_list.js +++ b/erpnext/selling/doctype/quotation/quotation_list.js @@ -1,6 +1,17 @@ frappe.listview_settings['Quotation'] = { add_fields: ["customer_name", "base_grand_total", "status", "company", "currency", 'valid_till'], + + onload: function(listview) { + listview.page.fields_dict.quotation_to.get_query = function() { + return { + "filters": { + "name": ["in", ["Customer", "Lead"]], + } + }; + }; + }, + get_indicator: function(doc) { if(doc.status==="Submitted") { if (doc.valid_till && doc.valid_till < frappe.datetime.nowdate()) {