From 4b8aa83e61e7e0d5b72a65611f0c82de6144c38c Mon Sep 17 00:00:00 2001 From: mbauskar Date: Fri, 15 Sep 2017 13:43:07 +0530 Subject: [PATCH] [minor] delete comment from documents _comments column on communication on_trash event --- frappe/core/doctype/communication/communication.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/communication/communication.py b/frappe/core/doctype/communication/communication.py index aa9a7c3a4e..a1ff57907a 100644 --- a/frappe/core/doctype/communication/communication.py +++ b/frappe/core/doctype/communication/communication.py @@ -7,7 +7,7 @@ from frappe import _ from frappe.model.document import Document from frappe.utils import validate_email_add, get_fullname, strip_html, cstr from frappe.core.doctype.communication.comment import (notify_mentions, - update_comment_in_doc) + update_comment_in_doc, on_trash) from frappe.core.doctype.communication.email import (validate_email, notify, _notify, update_parent_status) from frappe.utils.bot import BotReply @@ -111,6 +111,8 @@ class Communication(Document): frappe.publish_realtime('delete_communication', self.as_dict(), doctype= self.reference_doctype, docname = self.reference_name, after_commit=True) + # delete the comments from _comment + on_trash(self) def set_status(self): if not self.is_new():