From 5a1abf61382eb98a54c310386b07d7ddfb4c45ec 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/bom_update_tool/bom_update_tool.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. --- .../manufacturing/doctype/bom_update_tool/bom_update_tool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py index 983dd2d4cd8..70052591b6a 100644 --- a/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py +++ b/erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py @@ -32,8 +32,7 @@ class BOMUpdateTool(Document): def enqueue_replace_bom(boms: dict | str | None = None, args: dict | str | None = None) -> "BOMUpdateLog": """Returns a BOM Update Log (that queues a job) for BOM Replacement.""" boms = boms or args - if isinstance(boms, str): - boms = json.loads(boms) + boms = frappe.parse_json(boms) update_log = create_bom_update_log(boms=boms) return update_log