diff --git a/helpdesk_mgmt_activity/models/helpdesk_ticket.py b/helpdesk_mgmt_activity/models/helpdesk_ticket.py index d206a24851..fea6e0a64a 100644 --- a/helpdesk_mgmt_activity/models/helpdesk_ticket.py +++ b/helpdesk_mgmt_activity/models/helpdesk_ticket.py @@ -27,6 +27,7 @@ class HelpdeskTicket(models.Model): store=True, index=True, ) + is_new_stage = fields.Boolean(compute="_compute_is_new_stage") @api.model def _selection_record_ref(self): @@ -59,6 +60,11 @@ def _get_team_stages(self, teams): """ return {team.id: team._get_applicable_stages() for team in teams} + def _compute_is_new_stage(self): + for ticket in self: + new_stage = ticket.team_id._get_applicable_stages()[:1] + ticket.is_new_stage = ticket.stage_id == new_stage + @api.depends("stage_id") def _compute_next_stage_id(self): """Compute next stage for ticket""" diff --git a/helpdesk_mgmt_activity/views/helpdesk_ticket_view.xml b/helpdesk_mgmt_activity/views/helpdesk_ticket_view.xml index 33f3b0e78b..e55d682a9f 100644 --- a/helpdesk_mgmt_activity/views/helpdesk_ticket_view.xml +++ b/helpdesk_mgmt_activity/views/helpdesk_ticket_view.xml @@ -7,13 +7,14 @@ 99
+