From e4c25bf4bbc60aaab9c0eaebe35814c97f3677ac Mon Sep 17 00:00:00 2001 From: GangaManoj Date: Wed, 25 Aug 2021 15:40:42 +0530 Subject: [PATCH] fix: Return if there are no Items --- erpnext/stock/doctype/packed_item/packed_item.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index a42bde2a57..d8a8959a4d 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -109,6 +109,9 @@ def cleanup_packing_list(doc, parent_items): def update_product_bundle_price(doc, parent_items): """Updates the prices of Product Bundles based on the rates of the Items in the bundle.""" + if not doc.get('items'): + return + parent_items_index = 0 bundle_price = 0 parent_items_doctype = doc.items[0].doctype