refactor: parse native JSON request args in accounts/doctype/unreconcile_payment/unreconcile_payment.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:31 +05:30
parent 4fc952badf
commit fe8be87200

View File

@@ -201,9 +201,9 @@ def get_linked_advances(company, docname):
@frappe.whitelist()
def create_unreconcile_doc_for_selection(selections: str | None = None):
def create_unreconcile_doc_for_selection(selections: str | list | None = None):
if selections:
selections = json.loads(selections)
selections = frappe.parse_json(selections)
# assuming each row is a unique voucher
for row in selections:
unrecon = frappe.new_doc("Unreconcile Payment")