Skip to content

Commit

Permalink
Merge pull request #31825 from frappe/mergify/bp/version-13-hotfix/pr…
Browse files Browse the repository at this point in the history
…-31817

fix: limit pos recent order page result (backport #31817)
  • Loading branch information
deepeshgarg007 authored Aug 22, 2022
2 parents 75d57c1 + 9751f10 commit 6bc6681
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion erpnext/selling/page/point_of_sale/point_of_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,20 @@ def get_past_order_list(search_term, status, limit=20):
"POS Invoice",
filters={"customer": ["like", "%{}%".format(search_term)], "status": status},
fields=fields,
page_length=limit,
)
invoices_by_name = frappe.db.get_all(
"POS Invoice",
filters={"name": ["like", "%{}%".format(search_term)], "status": status},
fields=fields,
page_length=limit,
)

invoice_list = invoices_by_customer + invoices_by_name
elif status:
invoice_list = frappe.db.get_all("POS Invoice", filters={"status": status}, fields=fields)
invoice_list = frappe.db.get_all(
"POS Invoice", filters={"status": status}, fields=fields, page_length=limit
)

return invoice_list

Expand Down

0 comments on commit 6bc6681

Please sign in to comment.