From 339256bc71edae761d11faf771d75db987446de5 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 00:15:33 +0530 Subject: [PATCH] fix: filter validation for batch-wise balance history report (backport #41356) (#41360) fix: filter validation for batch-wise balance history report (#41356) fix: filter validation for batchwise balance history report (cherry picked from commit 544fc60093cfdc1a92c4ccced7ab5794626fd87c) Co-authored-by: rohitwaghchaure --- .../batch_wise_balance_history.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 8e27b8c4f69..7c23e4c8f1e 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 @@ -29,8 +29,15 @@ def execute(filters=None): sle_count = _estimate_table_row_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.")) + if ( + sle_count > SLE_COUNT_LIMIT + and not filters.get("item_code") + and not filters.get("warehouse") + and not filters.get("warehouse_type") + ): + frappe.throw( + _("Please select either the Item or Warehouse or Warehouse Type filter to generate the report.") + ) if filters.from_date > filters.to_date: frappe.throw(_("From Date must be before To Date"))