From 11237be4f5168f4f7a8081c85c68c73f113b7a22 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 3 May 2017 11:48:11 +0530 Subject: [PATCH] Recursive issue on checking permission for communication when it is linked to self --- frappe/core/doctype/communication/communication.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index 4908a1b66c..855681be5d 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -264,6 +264,10 @@ def on_doctype_update(): def has_permission(doc, ptype, user): if ptype=="read": + if (doc.reference_doctype == "Communication" and doc.reference_name == doc.name) \ + or (doc.timeline_doctype == "Communication" and doc.timeline_name == doc.name): + return + if doc.reference_doctype and doc.reference_name: if frappe.has_permission(doc.reference_doctype, ptype="read", doc=doc.reference_name): return True