From 2b7abfb34b6a3446d9efb990bc88fc59b59e323f Mon Sep 17 00:00:00 2001 From: Kavin <78342682+kavin0411@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:37:52 +0530 Subject: [PATCH] fix: handle NoneType object error for product bundle --- .../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 8d216171641..d9071c406a2 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 @@ -1390,13 +1390,15 @@ class SerialandBatchBundle(Document): so_name, so_detail_no = frappe.db.get_value( "Delivery Note Item", self.voucher_detail_no, ["against_sales_order", "so_detail"] - ) + ) or [None, None] if so_name and so_detail_no: sre_names = get_sre_against_so_for_dn(so_name, so_detail_no) return sre_names + return None + @frappe.whitelist() def download_blank_csv_template(content):