mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 09:53:09 +00:00
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:
@@ -404,8 +404,7 @@ def make_batch(kwargs):
|
|||||||
def get_pos_reserved_batch_qty(filters: dict | str):
|
def get_pos_reserved_batch_qty(filters: dict | str):
|
||||||
import json
|
import json
|
||||||
|
|
||||||
if isinstance(filters, str):
|
filters = frappe.parse_json(filters)
|
||||||
filters = json.loads(filters)
|
|
||||||
|
|
||||||
p = frappe.qb.DocType("POS Invoice").as_("p")
|
p = frappe.qb.DocType("POS Invoice").as_("p")
|
||||||
item = frappe.qb.DocType("POS Invoice Item").as_("item")
|
item = frappe.qb.DocType("POS Invoice Item").as_("item")
|
||||||
|
|||||||
Reference in New Issue
Block a user