From cb94c4b5f189e3fed9fbbe508490fa6d177a6ab7 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 23 Sep 2025 10:56:50 +0530 Subject: [PATCH] fix: warehouse for batch validation (cherry picked from commit 381072170a3a50915c7fa9f142304e192328c031) --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index cfc14ace3eb..aff309e5f80 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -774,7 +774,9 @@ class SerialandBatchBundle(Document): (parent.warehouse == self.warehouse) & (parent.voucher_type == "Stock Reconciliation") ) elif batches: - future_entries = future_entries.where(child.batch_no.isin(batches)) + future_entries = future_entries.where( + (child.batch_no.isin(batches)) & (parent.warehouse == self.warehouse) + ) future_entries = future_entries.run(as_dict=True)