mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 05:31:48 +00:00
refactor: parse native JSON request args in stock/doctype/putaway_rule/putaway_rule.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:
@@ -111,8 +111,7 @@ def apply_putaway_rule(
|
||||
purpose: Purpose of Stock Entry
|
||||
sync (optional): Sync with client side only for client side calls
|
||||
"""
|
||||
if isinstance(items, str):
|
||||
items = json.loads(items)
|
||||
items = frappe.parse_json(items)
|
||||
|
||||
items_not_accomodated, updated_table = [], []
|
||||
item_wise_rules = defaultdict(list)
|
||||
@@ -198,7 +197,7 @@ def apply_putaway_rule(
|
||||
frappe.msgprint(_("Applied putaway rules."), alert=True)
|
||||
return updated_table
|
||||
|
||||
if sync and json.loads(sync): # sync with client side
|
||||
if sync and frappe.parse_json(sync): # sync with client side
|
||||
return items
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user