From 5fce8191f90375225ec128c0b1a94d28b5f529e2 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 10 Jul 2025 22:46:56 +0530 Subject: [PATCH] fix: no attribute error in old subcontracting flow (cherry picked from commit 51751a7a055b8fd16c4a418894cc5698d4205477) --- erpnext/controllers/subcontracting_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/subcontracting_controller.py b/erpnext/controllers/subcontracting_controller.py index 22a71734f3d..0a9999df9df 100644 --- a/erpnext/controllers/subcontracting_controller.py +++ b/erpnext/controllers/subcontracting_controller.py @@ -464,7 +464,7 @@ class SubcontractingController(StockController): i += 1 def __remove_serial_and_batch_bundle(self, item): - if item.serial_and_batch_bundle: + if item.get("serial_and_batch_bundle"): frappe.delete_doc("Serial and Batch Bundle", item.serial_and_batch_bundle, force=True) def __get_materials_from_bom(self, item_code, bom_no, exploded_item=0):