mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-18 08:58:43 +00:00
fix(stock): don't KeyError when neither bundle nor item_code is passed
row is a plain dict subclass, so row["item_code"] raised an unhandled KeyError (500) when the payload had neither key. get_active_product_bundle already returns None for falsy input, yielding an empty item list. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -454,7 +454,7 @@ def get_items_from_product_bundle(row: str):
|
||||
frappe.bold(bundle_name)
|
||||
)
|
||||
)
|
||||
elif bundle_name := get_active_product_bundle(row["item_code"]):
|
||||
elif bundle_name := get_active_product_bundle(row.get("item_code")):
|
||||
frappe.has_permission("Product Bundle", "read", bundle_name, throw=True)
|
||||
|
||||
bundled_items = get_product_bundle_items_by_name(bundle_name) if bundle_name else []
|
||||
|
||||
Reference in New Issue
Block a user