Merge pull request #31817 from ruthra-kumar/fix_pos_recent_order_crash_due_to_large_data
fix: limit pos recent order page result
This commit is contained in:
commit
5018472840
@ -253,16 +253,20 @@ def get_past_order_list(search_term, status, limit=20):
|
|||||||
"POS Invoice",
|
"POS Invoice",
|
||||||
filters={"customer": ["like", "%{}%".format(search_term)], "status": status},
|
filters={"customer": ["like", "%{}%".format(search_term)], "status": status},
|
||||||
fields=fields,
|
fields=fields,
|
||||||
|
page_length=limit,
|
||||||
)
|
)
|
||||||
invoices_by_name = frappe.db.get_all(
|
invoices_by_name = frappe.db.get_all(
|
||||||
"POS Invoice",
|
"POS Invoice",
|
||||||
filters={"name": ["like", "%{}%".format(search_term)], "status": status},
|
filters={"name": ["like", "%{}%".format(search_term)], "status": status},
|
||||||
fields=fields,
|
fields=fields,
|
||||||
|
page_length=limit,
|
||||||
)
|
)
|
||||||
|
|
||||||
invoice_list = invoices_by_customer + invoices_by_name
|
invoice_list = invoices_by_customer + invoices_by_name
|
||||||
elif status:
|
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
|
return invoice_list
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user