From e14719b0ade5825bfd73835bbbe117204635f998 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:33 +0530 Subject: [PATCH] refactor: parse native JSON request args in manufacturing/doctype/production_plan/services/planning_queries.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. --- .../doctype/production_plan/services/planning_queries.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/manufacturing/doctype/production_plan/services/planning_queries.py b/erpnext/manufacturing/doctype/production_plan/services/planning_queries.py index 87ccdd2b5c7..615d840f08a 100644 --- a/erpnext/manufacturing/doctype/production_plan/services/planning_queries.py +++ b/erpnext/manufacturing/doctype/production_plan/services/planning_queries.py @@ -24,8 +24,7 @@ def get_bin_details( ): frappe.has_permission("Production Plan", "read", throw=True) - if isinstance(row, str): - row = frappe._dict(json.loads(row)) + row = frappe._dict(frappe.parse_json(row)) bin = frappe.qb.DocType("Bin") subquery = _bin_warehouse_subquery(bin, company, row, for_warehouse, all_warehouse) @@ -65,8 +64,7 @@ def _bin_qty_columns(bin): def get_warehouse_list(warehouses): warehouse_list = [] - if isinstance(warehouses, str): - warehouses = json.loads(warehouses) + warehouses = frappe.parse_json(warehouses) for row in warehouses: child_warehouses = frappe.db.get_descendants("Warehouse", row.get("warehouse"))