fix: hide payment and payment request buttons based on permissions in invoices and orders (backport #53920) (#54736)

Co-authored-by: Sakthivel Murugan S <129778327+ssakthivelmurugan@users.noreply.github.com>
Co-authored-by: ravibharathi656 <ravibharathi656@gmail.com>
fix: hide payment and payment request buttons based on permissions in invoices and orders (#53920)
This commit is contained in:
mergify[bot]
2026-05-05 12:17:57 +05:30
committed by GitHub
parent 2cd4c1a052
commit e60490dceb
4 changed files with 36 additions and 17 deletions

View File

@@ -1162,11 +1162,13 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex
}
// payment request
if (flt(doc.per_billed) < 100 + frappe.boot.sysdefaults.over_billing_allowance) {
this.frm.add_custom_button(
__("Payment Request"),
() => this.make_payment_request_with_schedule(),
__("Create")
);
if (frappe.boot.user.in_create.includes("Payment Request")) {
this.frm.add_custom_button(
__("Payment Request"),
() => this.make_payment_request_with_schedule(),
__("Create")
);
}
if (frappe.model.can_create("Payment Entry")) {
this.frm.add_custom_button(