perf: avoid full table scan in sle count check (#36428)
perf: avoid full table scan in sle count check (#36428)
(cherry picked from commit f31d07554d)
Co-authored-by: Ankush Menat <ankush@frappe.io>
This commit is contained in:
@@ -16,7 +16,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."))
|
||||
|
||||
Reference in New Issue
Block a user