Skip to content

Commit

Permalink
perf: avoid full table scan in sle count check (#36428)
Browse files Browse the repository at this point in the history
perf: avoid full table scan in sle count check (#36428)

(cherry picked from commit f31d075)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush authored Aug 1, 2023
1 parent 782a4d1 commit 04f9915
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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."))
Expand Down

0 comments on commit 04f9915

Please sign in to comment.