From 5b738b7b0d21289569c92f0f3a85c7a57f3a2981 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Thu, 2 Jul 2026 14:33:26 +0200 Subject: [PATCH] fix: don't attempt to create SABB for non-serialized / non-batch items (#56627) * fix: don't attempt to create SABB for non-serialized / non-batch items * fix(stock): skip serial batch lookup for rows without item code --- erpnext/stock/services/serial_batch_bundle_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/services/serial_batch_bundle_service.py b/erpnext/stock/services/serial_batch_bundle_service.py index 29d732c1e32..2e752371ed5 100644 --- a/erpnext/stock/services/serial_batch_bundle_service.py +++ b/erpnext/stock/services/serial_batch_bundle_service.py @@ -176,6 +176,10 @@ class SerialBatchBundleService: parent_details = self.get_parent_details_for_packed_items() for row in self.doc.get(table_name): + item_code = row.get("rm_item_code") or row.get("item_code") + if not item_code or not self.is_serial_batch_item(item_code): + continue + if ( not via_landed_cost_voucher and row.serial_and_batch_bundle