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.sla

Compute Method: _compute_deadline

Inputs Method Outputs
for record in self:
            if record.state in ["accomplished", "expired"] and record.deadline:
                # We want to keep the deadline in the past if the SLA is exceeded
                # If it is not defined, it will be recomputed for history
                continue
            else:
                date = record.last_state_date or record.ticket_id.create_date
                date = record.ticket_id.team_id.resource_calendar_id.plan_hours(
                    record.hours - record.consumed_time, date, compute_leaves=True
                )
                record.deadline = date

Back to entity