Skip to content

Commit

Permalink
fix(ux): sla: reopen: fetch resolution_date from old doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad committed Nov 8, 2023
1 parent 3f99ef8 commit 6b6313c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ def set_resolution_date(self, doc: Document):

def set_hold_time(self, doc: Document):
pause_on = [row.status for row in self.pause_sla_on]
prev_state = doc.get_doc_before_save().get("status")
doc_old = doc.get_doc_before_save()
prev_state = doc_old.get("status")
next_state = doc.get("status")
was_paused = prev_state in pause_on
is_paused = next_state in pause_on
paused_since = doc.resolution_date or doc.on_hold_since
paused_since = doc.on_hold_since or doc_old.get("resolution_date")
if is_paused and not was_paused:
doc.response_by = doc.resolution_by if doc.first_responded_on else None
doc.resolution_date = None
Expand Down

0 comments on commit 6b6313c

Please sign in to comment.