From 3fa7ec656b55d72355b0913460a1cf59d0e191f4 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Wed, 24 Jun 2026 20:55:01 +0530 Subject: [PATCH] fix: parse native JSON schedules arg in make_payment_request make_payment_request(**args) is whitelisted and the client passes `schedules` as a list, so json.loads(args.get("schedules")) raised TypeError under JSON body mode. Use frappe.parse_json. --- erpnext/accounts/doctype/payment_request/payment_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index c4d6f11f85b..26d5c2ce833 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -740,7 +740,7 @@ def make_payment_request(**args): # Schedule-based PRs are allowed only if no Payment Entry exists for this document. # Any existing Payment Entry forces legacy (amount-based) flow. - selected_payment_schedules = json.loads(args.get("schedules")) if args.get("schedules") else [] + selected_payment_schedules = frappe.parse_json(args.get("schedules")) if args.get("schedules") else [] # Backend guard: # If any Payment Entry exists, schedule-based PRs are not allowed.