Skip to content

Commit

Permalink
feat: deprecate get_customer_list (frappe#34563)
Browse files Browse the repository at this point in the history
feat: deprecate get_customer_list (frappe#34563)

(cherry picked from commit 8c7fa57)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
  • Loading branch information
mergify[bot] and barredterra authored Mar 24, 2023
1 parent 37f2ba8 commit 67576ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
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 = {
Expand Down
6 changes: 6 additions & 0 deletions erpnext/selling/doctype/customer/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 67576ad

Please sign in to comment.