From 487aff80e07eeafc33e20a3c35e89fa3656b15fc 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/pick_list/mapper.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/pick_list/mapper.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/stock/doctype/pick_list/mapper.py b/erpnext/stock/doctype/pick_list/mapper.py index 2d7f0e91ab8..b1168e112a8 100644 --- a/erpnext/stock/doctype/pick_list/mapper.py +++ b/erpnext/stock/doctype/pick_list/mapper.py @@ -113,8 +113,7 @@ def create_dn_for_pick_lists( """Get Items from Multiple Pick Lists and create a Delivery Note for filtered customer""" if kwargs is None: kwargs = {} - if isinstance(kwargs, str): - kwargs = json.loads(kwargs) + kwargs = frappe.parse_json(kwargs) pick_list = frappe.get_doc("Pick List", source_name) validate_item_locations(pick_list) @@ -282,8 +281,8 @@ def add_product_bundles_to_target(pick_list, target_doc, item_mapper, sales_orde @frappe.whitelist() -def create_stock_entry(pick_list: str): - pick_list = frappe.get_doc(json.loads(pick_list)) +def create_stock_entry(pick_list: str | dict): + pick_list = frappe.get_doc(frappe.parse_json(pick_list)) validate_item_locations(pick_list) if stock_entry_exists(pick_list.get("name")):