mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 03:39:11 +00:00
Extend search_fields for customer querie
This PR is intended to extend the customer querie adding the meta-info from the doctype using the search fields to extend the customer querie
This commit is contained in:
@@ -86,6 +86,9 @@ def customer_query(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
else:
|
else:
|
||||||
fields = ["name", "customer_name", "customer_group", "territory"]
|
fields = ["name", "customer_name", "customer_group", "territory"]
|
||||||
|
|
||||||
|
meta = frappe.get_meta("Customer")
|
||||||
|
fields = fields + [f for f in meta.get_search_fields() if not f in fields]
|
||||||
|
|
||||||
fields = ", ".join(fields)
|
fields = ", ".join(fields)
|
||||||
|
|
||||||
return frappe.db.sql("""select {fields} from `tabCustomer`
|
return frappe.db.sql("""select {fields} from `tabCustomer`
|
||||||
|
|||||||
Reference in New Issue
Block a user