From bead28e7baaf991c0aece563418dfdc7185956e7 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 20 Jul 2016 13:22:23 +0530 Subject: [PATCH] [fix] test --- frappe/core/doctype/communication/email.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index c4b96bcd05..d750d18373 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -147,14 +147,16 @@ def update_parent_status(doc): return status_field = parent.meta.get_field("status") - options = (status_field.options or '').splitlines() - # 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 status_field: + options = (status_field.options or '').splitlines() - if to_status in options: - parent.db_set("status", to_status) + # if status has a "Replied" option, then update the status + if 'Replied' in options: + to_status = "Open" if doc.sent_or_received=="Received" else "Replied" + + if to_status in options: + parent.db_set("status", to_status) update_mins_to_first_communication(parent, doc) parent.run_method('notify_communication', doc)