Skip to content

Commit

Permalink
fix: limit pos recent order page result
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Aug 9, 2022
1 parent 17b9bfd commit bb40e38
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 @@ -253,16 +253,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 bb40e38

Please sign in to comment.