From 0cbb7f8714f8051e5e4f9c9d4638b8b051b4670c Mon Sep 17 00:00:00 2001 From: kavin-114 Date: Tue, 3 Feb 2026 13:41:21 +0530 Subject: [PATCH] fix(stock): add stock recon opening stock condition --- erpnext/stock/report/stock_balance/stock_balance.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 2535fc4096f..913a31df1a7 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -198,7 +198,11 @@ class StockBalanceReport: for field in self.inventory_dimensions: qty_dict[field] = entry.get(field) - if entry.voucher_type == "Stock Reconciliation" and (not entry.batch_no or entry.serial_no): + 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) + ): qty_diff = flt(entry.qty_after_transaction) - flt(qty_dict.bal_qty) else: qty_diff = flt(entry.actual_qty)