From 2985a8b263310718775156aa2142d8e6ff7b4af3 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/pos_invoice/pos_invoice.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/pos_invoice/pos_invoice.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py index 23ef9099b6d..71d04db1ea0 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -1036,8 +1036,7 @@ def make_sales_return(source_name: str, target_doc: Document | str | None = None def make_merge_log(invoices: str | list): import json - if isinstance(invoices, str): - invoices = json.loads(invoices) + invoices = frappe.parse_json(invoices) if len(invoices) == 0: frappe.throw(_("At least one invoice has to be selected."))