From a7e34056acb21cebe38f09e866b69bc92706a9f9 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:11:03 +0200 Subject: [PATCH] fix: respect ignore_permission flag --- landa/address_and_contact.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/landa/address_and_contact.py b/landa/address_and_contact.py index afeff4a8..62d9b9f9 100644 --- a/landa/address_and_contact.py +++ b/landa/address_and_contact.py @@ -32,9 +32,10 @@ def validate(doc, event): doc.organization = None for link in doc.links: - # Linking an Address or Contact should be treated like writing to the linked doc - linked_doc = frappe.get_doc(link.link_doctype, link.link_name) - linked_doc.check_permission("write") + if not doc.flags.ignore_permissions: + # Linking an Address or Contact should be treated like writing to the linked doc + linked_doc = frappe.get_doc(link.link_doctype, link.link_name) + linked_doc.check_permission("write") if link.link_doctype == "Customer": doc.organization = link.link_name