fix(minor): opportunity_from may not be selected (#19063)

diff --git a/erpnext/crm/doctype/opportunity/opportunity_list.js b/erpnext/crm/doctype/opportunity/opportunity_list.js
index af53bf7..24b0514 100644
--- a/erpnext/crm/doctype/opportunity/opportunity_list.js
+++ b/erpnext/crm/doctype/opportunity/opportunity_list.js
@@ -18,12 +18,14 @@
 			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"]],
+					}
+				};
 			};
-		};
+		}
 	}
 };