From 36ccd24b68ecab5af8cf934d36653366c92bc148 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 14 Jun 2016 16:29:45 +0530 Subject: [PATCH] [fix] mins_to_first_response --- frappe/core/doctype/communication/email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/core/doctype/communication/email.py b/frappe/core/doctype/communication/email.py index 3c97009f76..83773e62ec 100755 --- a/frappe/core/doctype/communication/email.py +++ b/frappe/core/doctype/communication/email.py @@ -6,7 +6,7 @@ import frappe import json from email.utils import formataddr, parseaddr from frappe.utils import (get_url, get_formatted_email, cint, - validate_email_add, split_emails, now, time_diff_in_seconds) + validate_email_add, split_emails, time_diff_in_seconds) from frappe.utils.file_manager import get_file from frappe.email.bulk import check_bulk_limit from frappe.utils.scheduler import log @@ -408,7 +408,7 @@ def update_mins_to_first_communication(parent, communication): if parent.meta.has_field('mins_to_first_response') and not parent.get('mins_to_first_response'): if frappe.db.get_all('User', filters={'email': communication.sender, 'user_type': 'System User', 'enabled': 1}, limit=1): - first_responded_on = now() + first_responded_on = communication.creation if parent.meta.has_field('first_responded_on'): parent.db_set('first_responded_on', first_responded_on) parent.db_set('mins_to_first_response', round(time_diff_in_seconds(first_responded_on, parent.creation) / 60), 2)