From f4ed4cae647c6718a2d194e09474f77533229c39 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 16:08:38 +0000 Subject: [PATCH] fix(stock): ignore cancelled batch entries in valuation (backport #58659) (#58660) fix(stock): ignore cancelled batch entries in valuation (#58659) (cherry picked from commit a9b857bdfec6732380db6078e9788f41d62391f4) # Conflicts: # erpnext/stock/serial_batch_bundle.py Co-authored-by: Pandiyan P --- erpnext/stock/serial_batch_bundle.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index e8e674ee7b2..e91c3954c0d 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -943,6 +943,7 @@ class BatchNoValuation(DeprecatedBatchNoValuation): & (child.warehouse == self.sle.warehouse) & (child.batch_no.isin(self.batchwise_valuation_batches)) & (child.docstatus == 1) + & (child.is_cancelled == 0) & (child.type_of_transaction.isin(["Inward", "Outward"])) ) .for_update()