mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
feat: add permission check for custom button
This commit is contained in:
@@ -133,7 +133,10 @@ frappe.ui.form.on("Supplier", {
|
|||||||
__("Actions")
|
__("Actions")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (cint(frappe.defaults.get_default("enable_common_party_accounting"))) {
|
if (
|
||||||
|
cint(frappe.defaults.get_default("enable_common_party_accounting")) &&
|
||||||
|
frappe.model.can_create("Party Link")
|
||||||
|
) {
|
||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
__("Link with Customer"),
|
__("Link with Customer"),
|
||||||
function () {
|
function () {
|
||||||
|
|||||||
@@ -190,7 +190,10 @@ frappe.ui.form.on("Customer", {
|
|||||||
__("Actions")
|
__("Actions")
|
||||||
);
|
);
|
||||||
|
|
||||||
if (cint(frappe.defaults.get_default("enable_common_party_accounting"))) {
|
if (
|
||||||
|
cint(frappe.defaults.get_default("enable_common_party_accounting")) &&
|
||||||
|
frappe.model.can_create("Party Link")
|
||||||
|
) {
|
||||||
frm.add_custom_button(
|
frm.add_custom_button(
|
||||||
__("Link with Supplier"),
|
__("Link with Supplier"),
|
||||||
function () {
|
function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user