fix: ensure type on method parameter

(cherry picked from commit c055e86e51)
This commit is contained in:
ruthra kumar
2025-12-16 14:05:28 +05:30
committed by Mergify
parent 8dcb2f39c2
commit 16c8b74d52

View File

@@ -545,6 +545,9 @@ def make_payment_request(**args):
if args.dt not in ALLOWED_DOCTYPES_FOR_PAYMENT_REQUEST:
frappe.throw(_("Payment Requests cannot be created against: {0}").format(frappe.bold(args.dt)))
if args.dn and not isinstance(args.dn, str):
frappe.throw(_("Invalid parameter. 'dn' should be of type str"))
ref_doc = args.ref_doc or frappe.get_doc(args.dt, args.dn)
if not args.get("company"):
args.company = ref_doc.company