Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Helpdesk Ticket SLA

Entity: helpdesk.ticket

Compute Method: _compute_sla_data

Inputs Method Outputs
now = fields.Datetime.now()
for ticket in self:
            ticket.sla_expired = any(
                ticket.ticket_sla_ids.filtered(
                    lambda sla: sla.state == "expired"
                    or (
                        sla.state == "in_progress"
                        and sla.deadline
                        and sla.deadline < now
                    )
                )
            )
            ticket.sla_deadline = min(
                ticket.ticket_sla_ids.filtered(
                    lambda r: r.state == "in_progress"
                ).mapped("deadline"),
                default=False,
            )

Back to entity