commit | f31d07554d05f5b325d8770b90e70e9ee214844b | [log] [tgz] |
---|---|---|
author | Ankush Menat <ankush@frappe.io> | Mon Jul 31 22:13:47 2023 +0530 |
committer | GitHub <noreply@github.com> | Mon Jul 31 22:13:47 2023 +0530 |
tree | 76382142f789cfca42b57e39e530f6ac31052798 | |
parent | f83a100a8d41de0c539599394d9bf7260fef847b [diff] |
perf: avoid full table scan in sle count check (#36428)
diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py index bdc9d74..176a215 100644 --- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py +++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.py
@@ -17,7 +17,7 @@ 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."))