Skip to content

Commit

Permalink
fix(ux): set first response at even without replied status
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad committed Oct 23, 2023
1 parent de10d81 commit 63333c3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def before_validate(self):
self.set_contact()
self.set_customer()
self.set_priority()
self.set_first_responded_on()
self.set_feedback_values()
self.apply_escalation_rule()
self.set_sla()
Expand Down Expand Up @@ -233,10 +232,6 @@ def set_priority(self):
or DEFAULT_TICKET_PRIORITY
)

def set_first_responded_on(self):
if self.status == "Replied" and not self.first_responded_on:
self.first_responded_on = frappe.utils.now_datetime()

def set_feedback_values(self):
if not self.feedback:
return
Expand Down Expand Up @@ -738,6 +733,12 @@ def on_communication_update(self, c):
# be reopened.
if c.sent_or_received == "Received":
self.status = "Open"
# If communication is outgoing, it must be a reply from agent
if c.sent_or_received == "Sent":
# Set first response date if not set already
self.first_responded_on = (
self.first_responded_on or frappe.utils.now_datetime()
)
# Fetch description from communication if not set already. This might not be needed
# anymore as a communication is created when a ticket is created.
self.description = self.description or c.content
Expand Down

0 comments on commit 63333c3

Please sign in to comment.