Compare commits

...

1 Commits

Author SHA1 Message Date
Ankush Menat
f784b17564 perf: avoid full table scan in sle count check 2023-07-31 20:06:46 +05:30

View File

@@ -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."))