From 68e92a893a47f0d775716e7c95634a7392f35a4c Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:34 +0530 Subject: [PATCH] refactor: parse native JSON request args in stock/doctype/packed_item/packed_item.py Use frappe.parse_json instead of json.loads so the whitelisted endpoints accept native JSON types (list/dict/bool) in addition to JSON strings. --- erpnext/stock/doctype/packed_item/packed_item.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 7dbeb109c59..5aff12994c9 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -432,7 +432,7 @@ def on_doctype_update(): @frappe.whitelist() -def get_items_from_product_bundle(row: str): +def get_items_from_product_bundle(row: str | dict): """Item details for each component of a Product Bundle. ``row.product_bundle`` selects a specific version by document name (the buying @@ -441,7 +441,7 @@ def get_items_from_product_bundle(row: str): """ from erpnext.selling.doctype.product_bundle.product_bundle import get_active_product_bundle - row, items = ItemDetailsCtx(json.loads(row)), [] + row, items = ItemDetailsCtx(frappe.parse_json(row)), [] if bundle_name := row.get("product_bundle"): frappe.has_permission("Product Bundle", "read", bundle_name, throw=True)