From 1a576df873d73f57d606842e022e5a204c4c88ed Mon Sep 17 00:00:00 2001 From: prssanna Date: Sat, 23 May 2020 14:30:05 +0530 Subject: [PATCH] fix: apply assignment rule on setting status as open --- frappe/core/doctype/communication/email.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index 8793c60934..4498dc3b08 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -190,7 +190,7 @@ def update_parent_mins_to_first_response(doc): # if status has a "Replied" option, then update the status for received communication if ('Replied' in options) and doc.sent_or_received=="Received": - parent.db_set("status", "Open") + update_document_status_on_received_communication(parent) else: # update the modified date for document parent.update_modified() @@ -199,6 +199,11 @@ def update_parent_mins_to_first_response(doc): parent.run_method('notify_communication', doc) parent.notify_update() +def update_document_status_on_received_communication(doc): + from frappe.automation.doctype.assignment_rule.assignment_rule import apply + doc.db_set("status", "Open") + apply(doc) + def get_recipients_cc_and_bcc(doc, recipients, cc, bcc, fetched_from_email_account=False): doc.all_email_addresses = [] doc.sent_email_addresses = []