From 04a93cabf18a5ba06bdf2538e85c846e8df9fa7d Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:37:34 +0530 Subject: [PATCH] refactor: parse native JSON request args in stock/doctype/batch/batch.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/batch/batch.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index 57b133bb4cc..46c059b25c9 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -404,8 +404,7 @@ def make_batch(kwargs): def get_pos_reserved_batch_qty(filters: dict | str): import json - if isinstance(filters, str): - filters = json.loads(filters) + filters = frappe.parse_json(filters) p = frappe.qb.DocType("POS Invoice").as_("p") item = frappe.qb.DocType("POS Invoice Item").as_("item")