From 72dcb511772d2c884d23c7220be392009ccef32c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 16 Sep 2019 14:47:43 +0530 Subject: [PATCH] fix(minor): opportunity_from may not be selected (#19063) --- .../crm/doctype/opportunity/opportunity_list.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity_list.js b/erpnext/crm/doctype/opportunity/opportunity_list.js index af53bf7fbf..24b05145fd 100644 --- a/erpnext/crm/doctype/opportunity/opportunity_list.js +++ b/erpnext/crm/doctype/opportunity/opportunity_list.js @@ -18,12 +18,14 @@ frappe.listview_settings['Opportunity'] = { listview.call_for_selected_items(method, {"status": "Closed"}); }); - listview.page.fields_dict.opportunity_from.get_query = function() { - return { - "filters": { - "name": ["in", ["Customer", "Lead"]], - } + if(listview.page.fields_dict.opportunity_from) { + listview.page.fields_dict.opportunity_from.get_query = function() { + return { + "filters": { + "name": ["in", ["Customer", "Lead"]], + } + }; }; - }; + } } };