From ab5f01a664dc370f83f66f2b53cc1ac753a2b23d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 20 Jul 2016 12:59:05 +0530 Subject: [PATCH] [minor] use replied option to opt-in for email status, fixes #1885 --- frappe/core/doctype/communication/email.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index aaf1e72dd6..c4b96bcd05 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -147,11 +147,13 @@ def update_parent_status(doc): return status_field = parent.meta.get_field("status") + options = (status_field.options or '').splitlines() - if status_field: + # if status has a "Replied" option, then update the status + if status_field and 'Replied' in options: to_status = "Open" if doc.sent_or_received=="Received" else "Replied" - if to_status in (status_field.options or '').splitlines(): + if to_status in options: parent.db_set("status", to_status) update_mins_to_first_communication(parent, doc)