Merge pull request #49429 from rohitwaghchaure/fixed-valuation-for-batch-v15

fix: valuation for batch items
This commit is contained in:
rohitwaghchaure
2025-09-02 19:11:10 +05:30
committed by GitHub

View File

@@ -770,12 +770,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))