mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 15:45:01 +00:00
Merge pull request #39235 from GursheenK/validation-for-payment-requests
fix(minor): validate doctype before creating payment request
This commit is contained in:
@@ -424,6 +424,15 @@ def make_payment_request(**args):
|
||||
"""Make payment request"""
|
||||
|
||||
args = frappe._dict(args)
|
||||
if args.dt not in [
|
||||
"Sales Order",
|
||||
"Purchase Order",
|
||||
"Sales Invoice",
|
||||
"Purchase Invoice",
|
||||
"POS Invoice",
|
||||
"Fees",
|
||||
]:
|
||||
frappe.throw(_("Payment Requests cannot be created against: {0}").format(frappe.bold(args.dt)))
|
||||
|
||||
ref_doc = frappe.get_doc(args.dt, args.dn)
|
||||
gateway_account = get_gateway_details(args) or frappe._dict()
|
||||
|
||||
Reference in New Issue
Block a user