diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index 0a316bd2974..cf3506a67d3 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -133,7 +133,10 @@ frappe.ui.form.on("Supplier", { __("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( __("Link with Customer"), function () { diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index aa8bea55094..598452276cc 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -175,7 +175,10 @@ frappe.ui.form.on("Customer", { __("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( __("Link with Supplier"), function () {