From a11eb741e50866ee64c21b7f4a35c142b6ad37b7 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:35 +0530 Subject: [PATCH] refactor: parse native JSON request args in stock/doctype/purchase_receipt/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/purchase_receipt/mapper.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/purchase_receipt/mapper.py b/erpnext/stock/doctype/purchase_receipt/mapper.py index 273afcec7a9..528b6865ed5 100644 --- a/erpnext/stock/doctype/purchase_receipt/mapper.py +++ b/erpnext/stock/doctype/purchase_receipt/mapper.py @@ -60,8 +60,7 @@ def make_purchase_invoice( ): if args is None: args = {} - if isinstance(args, str): - args = json.loads(args) + args = frappe.parse_json(args) from erpnext.accounts.party import get_payment_terms_template