Skip to content

Commit

Permalink
Merge pull request #31817 from ruthra-kumar/fix_pos_recent_order_cras…
Browse files Browse the repository at this point in the history
…h_due_to_large_data

fix: limit pos recent order page result
  • Loading branch information
ruthra-kumar authored Aug 10, 2022
2 parents eb25edd + bb40e38 commit 5018472
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 5018472

Please sign in to comment.