feat: deprecate get_customer_list (#34563)

feat: deprecate get_customer_list (#34563)

(cherry picked from commit 8c7fa5712b)

Co-authored-by: Raffael Meyer <14891507+barredterra@users.noreply.github.com>
This commit is contained in:
mergify[bot]
2023-03-24 15:14:25 +05:30
committed by GitHub
parent 37f2ba882e
commit 67576ad5bd
2 changed files with 7 additions and 1 deletions

View File

@@ -276,7 +276,7 @@ has_website_permission = {
before_tests = "erpnext.setup.utils.before_tests" before_tests = "erpnext.setup.utils.before_tests"
standard_queries = { standard_queries = {
"Customer": "erpnext.selling.doctype.customer.customer.get_customer_list", "Customer": "erpnext.controllers.queries.customer_query",
} }
doc_events = { doc_events = {

View File

@@ -451,8 +451,14 @@ def get_nested_links(link_doctype, link_name, ignore_permissions=False):
@frappe.whitelist() @frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs @frappe.validate_and_sanitize_search_inputs
def get_customer_list(doctype, txt, searchfield, start, page_len, filters=None): 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 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"] fields = ["name", "customer_name", "customer_group", "territory"]
if frappe.db.get_default("cust_master_name") == "Customer Name": if frappe.db.get_default("cust_master_name") == "Customer Name":