perf: avoid full table scan in sle count check (#36428)
This commit is contained in:
parent
f83a100a8d
commit
f31d07554d
@ -17,7 +17,7 @@ def execute(filters=None):
|
||||
if not filters:
|
||||
filters = {}
|
||||
|
||||
sle_count = frappe.db.count("Stock Ledger Entry", {"is_cancelled": 0})
|
||||
sle_count = frappe.db.count("Stock Ledger Entry")
|
||||
|
||||
if sle_count > SLE_COUNT_LIMIT and not filters.get("item_code") and not filters.get("warehouse"):
|
||||
frappe.throw(_("Please select either the Item or Warehouse filter to generate the report."))
|
||||
|
Loading…
x
Reference in New Issue
Block a user