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.
This commit is contained in:
Mihir Kandoi
2026-06-24 20:37:34 +05:30
parent 460b8c5d8d
commit 04a93cabf1

View File

@@ -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")