From 4fc952badf93de472f93b47fca02a1d0983c50ce Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:31 +0530 Subject: [PATCH] refactor: parse native JSON request args in accounts/doctype/purchase_invoice/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/accounts/doctype/purchase_invoice/mapper.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/mapper.py b/erpnext/accounts/doctype/purchase_invoice/mapper.py index 7c50121f1e5..0d0a771ea37 100644 --- a/erpnext/accounts/doctype/purchase_invoice/mapper.py +++ b/erpnext/accounts/doctype/purchase_invoice/mapper.py @@ -50,8 +50,7 @@ def make_purchase_receipt( ): if args is None: args = {} - if isinstance(args, str): - args = json.loads(args) + args = frappe.parse_json(args) def post_parent_process(source_parent, target_parent): remove_items_with_zero_qty(target_parent)