mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-08 21:12:32 +00:00
fix: enfore permission on make_payment_request
(cherry picked from commit b755ca12ca)
This commit is contained in:
@@ -535,10 +535,12 @@ class PaymentRequest(Document):
|
|||||||
row_number += TO_SKIP_NEW_ROW
|
row_number += TO_SKIP_NEW_ROW
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist()
|
||||||
def make_payment_request(**args):
|
def make_payment_request(**args):
|
||||||
"""Make payment request"""
|
"""Make payment request"""
|
||||||
|
|
||||||
|
frappe.has_permission(doctype="Payment Request", ptype="write", throw=True)
|
||||||
|
|
||||||
args = frappe._dict(args)
|
args = frappe._dict(args)
|
||||||
if args.dt not in ALLOWED_DOCTYPES_FOR_PAYMENT_REQUEST:
|
if args.dt not in ALLOWED_DOCTYPES_FOR_PAYMENT_REQUEST:
|
||||||
frappe.throw(_("Payment Requests cannot be created against: {0}").format(frappe.bold(args.dt)))
|
frappe.throw(_("Payment Requests cannot be created against: {0}").format(frappe.bold(args.dt)))
|
||||||
|
|||||||
Reference in New Issue
Block a user