Hello, i Am trying to return an email template when sla status fails as follows but i am not getting any mail after fail.
here is my code
for status in self:
if status.reached_datetime: # if reached_datetime, SLA is finished: either failed or succeeded
if status.reached_datetime < status.deadline:
status.status = 'reached'
else:
status.status = 'failed'
else: # if not finished, deadline should be compared to now()
if status.deadline > fields.Datetime.now():
status.status = 'ongoing'
else:
status.status = 'failed'
return self.env.ref('helpdesk.solved_ticket_request_email_template')