From 24e0e3505dc3415e86e04b0c1a613e66732cd0a5 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 2 Sep 2025 15:02:56 +0530 Subject: [PATCH] fix: valuation for batch items --- erpnext/stock/serial_batch_bundle.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index d34b449c819..bb23ee3e584 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -804,12 +804,15 @@ class BatchNoValuation(DeprecatedBatchNoValuation): self.non_batchwise_valuation_batches = self.batches return - batches = frappe.get_all( - "Batch", filters={"name": ("in", self.batches), "use_batchwise_valuation": 1}, fields=["name"] - ) + if get_valuation_method(self.sle.item_code) == "FIFO": + self.batchwise_valuation_batches = self.batches + else: + batches = frappe.get_all( + "Batch", filters={"name": ("in", self.batches), "use_batchwise_valuation": 1}, fields=["name"] + ) - for batch in batches: - self.batchwise_valuation_batches.append(batch.name) + for batch in batches: + self.batchwise_valuation_batches.append(batch.name) self.non_batchwise_valuation_batches = list(set(self.batches) - set(self.batchwise_valuation_batches))