From 32d72fdecb04d99453e015bdc87851e1e0ab237d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 12:49:06 +0530 Subject: [PATCH] fix: Only calculate first_respone_time if SLA is set (#27789) (#27793) Co-authored-by: Afshan <33727827+AfshanKhan@users.noreply.github.com> (cherry picked from commit ad03eb25df6c07beb744a0fe3003a4c6fb19b98e) Co-authored-by: Ganga Manoj --- erpnext/support/doctype/issue/issue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py index 272e3be2648..91ef68ae001 100644 --- a/erpnext/support/doctype/issue/issue.py +++ b/erpnext/support/doctype/issue/issue.py @@ -539,7 +539,7 @@ def get_time_in_timedelta(time): def set_first_response_time(communication, method): if communication.get('reference_doctype') == "Issue": issue = get_parent_doc(communication) - if is_first_response(issue): + if is_first_response(issue) and issue.service_level_agreement: first_response_time = calculate_first_response_time(issue, get_datetime(issue.first_responded_on)) issue.db_set("first_response_time", first_response_time)