Skip to content

Commit 3857d75

Browse files
shariquerikmergify[bot]
authored andcommitted
fix: ensure first response time is calculated before last response time
(cherry picked from commit 09fa8e5)
1 parent fa396d7 commit 3857d75

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crm/fcrm/doctype/crm_service_level_agreement/crm_service_level_agreement.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ def set_first_response_time(self, doc: Document):
9898
end_at = doc.first_responded_on
9999
if not start_at or not end_at:
100100
return
101-
doc.first_response_time = self.calc_elapsed_time(start_at, end_at)
102-
if not doc.last_response_time:
101+
if not doc.first_response_time:
102+
doc.first_response_time = self.calc_elapsed_time(start_at, end_at)
103+
104+
if not doc.last_response_time and doc.first_response_time:
103105
doc.last_response_time = doc.first_response_time
104106

105107
def set_rolling_responses(self, doc: Document):

0 commit comments

Comments
 (0)