mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-14 04:15:10 +00:00
feat: add permission check for custom button
(cherry picked from commit 00fd1d2f26)
This commit is contained in:
committed by
Mergify
parent
7280034abd
commit
9db9dd6f35
@@ -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 () {
|
||||||
|
|||||||
@@ -175,7 +175,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