From 67576ad5bdc78aa8ef79b6bf915df2ba87b9e21f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:14:25 +0530 Subject: [PATCH] feat: deprecate get_customer_list (#34563) feat: deprecate get_customer_list (#34563) (cherry picked from commit 8c7fa5712b303798e4d41c229c4b1b0c476897ef) Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com> --- erpnext/hooks.py | 2 +- erpnext/selling/doctype/customer/customer.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index e24038d0c6e..f1ee370e97e 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -276,7 +276,7 @@ has_website_permission = { before_tests = "erpnext.setup.utils.before_tests" standard_queries = { - "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list", + "Customer": "erpnext.controllers.queries.customer_query", } doc_events = { diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 0abbbcf0fc6..a8665c5d040 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -451,8 +451,14 @@ def get_nested_links(link_doctype, link_name, ignore_permissions=False): @frappe.whitelist() @frappe.validate_and_sanitize_search_inputs def get_customer_list(doctype, txt, searchfield, start, page_len, filters=None): + from frappe.utils.deprecations import deprecation_warning + from erpnext.controllers.queries import get_fields + deprecation_warning( + "`get_customer_list` is deprecated and will be removed in version 15. Use `erpnext.controllers.queries.customer_query` instead." + ) + fields = ["name", "customer_name", "customer_group", "territory"] if frappe.db.get_default("cust_master_name") == "Customer Name":