From f1ba8258185709142e43adf65f9d60225b94a291 Mon Sep 17 00:00:00 2001 From: kavin-114 Date: Tue, 3 Feb 2026 18:36:18 +0530 Subject: [PATCH] fix(stock): fetch batch wise valuation rate in get_items (cherry picked from commit c5df570262a5efded9292029e59694f86b5bfc7d) --- .../doctype/stock_reconciliation/stock_reconciliation.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 5359995ea9c..8ab9cf210ce 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -1266,15 +1266,11 @@ def get_items(warehouse, posting_date, posting_time, company, item_code=None, ig for d in items: if (d.item_code, d.warehouse) in itemwise_batch_data: - valuation_rate = get_stock_balance( - d.item_code, d.warehouse, posting_date, posting_time, with_valuation_rate=True - )[1] - for row in itemwise_batch_data.get((d.item_code, d.warehouse)): if ignore_empty_stock and not row.qty: continue - args = get_item_data(row, row.qty, valuation_rate) + args = get_item_data(row, row.qty, row.valuation_rate) res.append(args) else: stock_bal = get_stock_balance( @@ -1408,6 +1404,7 @@ def get_itemwise_batch(warehouse, posting_date, company, item_code=None): "item_code": row[0], "warehouse": row[3], "qty": row[8], + "valuation_rate": row[9], "item_name": row[1], "batch_no": row[4], }