From e0093199b179df5f596a0d929a176b93fd9e8ab6 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 5 Feb 2026 14:32:48 +0530 Subject: [PATCH 1/2] fix: stock balance report issue (cherry picked from commit 7e584dd84aef472c80385cc3f7f55f4301e9f98b) (cherry picked from commit 62616ad9e1685faf09fdada25dfb9da637c774c4) --- erpnext/stock/report/stock_balance/stock_balance.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 559e1b31a36..524b8d830d2 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -282,10 +282,8 @@ class StockBalanceReport: for field in self.inventory_dimensions: qty_dict[field] = entry.get(field) - if ( - entry.voucher_type == "Stock Reconciliation" - and frappe.get_cached_value(entry.voucher_type, entry.voucher_no, "purpose") != "Opening Stock" - and (not entry.batch_no or entry.serial_no) + if entry.voucher_type == "Stock Reconciliation" and ( + not entry.batch_no or not entry.serial_no or not entry.serial_and_batch_bundle ): qty_diff = flt(entry.qty_after_transaction) - flt(qty_dict.bal_qty) else: From 4305415ed95a51605ae051ccc080f38b2a2b2a53 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 5 Feb 2026 15:02:47 +0530 Subject: [PATCH 2/2] chore: fix issue (cherry picked from commit 1d24abf5ddccabce25863d793dd6dd3c67922e70) --- erpnext/stock/report/stock_balance/stock_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 524b8d830d2..ccee40ce25f 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -283,7 +283,7 @@ class StockBalanceReport: qty_dict[field] = entry.get(field) if entry.voucher_type == "Stock Reconciliation" and ( - not entry.batch_no or not entry.serial_no or not entry.serial_and_batch_bundle + not entry.batch_no and not entry.serial_no and not entry.serial_and_batch_bundle ): qty_diff = flt(entry.qty_after_transaction) - flt(qty_dict.bal_qty) else: