mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
Merge pull request #49435 from frappe/mergify/bp/version-15-hotfix/pr-49374
fix: improve permission handling for party link creation (backport #49374)
This commit is contained in:
@@ -74,6 +74,6 @@ def create_party_link(primary_role, primary_party, secondary_party):
|
|||||||
party_link.secondary_role = "Customer" if primary_role == "Supplier" else "Supplier"
|
party_link.secondary_role = "Customer" if primary_role == "Supplier" else "Supplier"
|
||||||
party_link.secondary_party = secondary_party
|
party_link.secondary_party = secondary_party
|
||||||
|
|
||||||
party_link.save(ignore_permissions=True)
|
party_link.save()
|
||||||
|
|
||||||
return party_link
|
return party_link
|
||||||
|
|||||||
@@ -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