瀏覽代碼

[fix] mins_to_first_response

version-14
Rushabh Mehta 9 年之前
父節點
當前提交
36ccd24b68
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      frappe/core/doctype/communication/email.py

+ 2
- 2
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)

Loading…
取消
儲存