From fef29c62f56c2a7374bd497a2f6c3f95f3c18716 Mon Sep 17 00:00:00 2001 From: Vincent Larcin Date: Fri, 4 Aug 2023 14:31:05 +0200 Subject: [PATCH] [IMP] project: update date_last_stage_update when changing state Currently, the field date_last_stage_update is updated when the state of the task is changed, but only if the target stage is a closing state. It could however be useful to know when the state was last changed regardless of if it's closing or not. This commit makes it so that the field is updated after any state change. Task-3455177 Part-of: odoo/odoo#130880 --- addons/project/models/project_task.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/project/models/project_task.py b/addons/project/models/project_task.py index 44efc4f2d9f..01360b31fdb 100644 --- a/addons/project/models/project_task.py +++ b/addons/project/models/project_task.py @@ -1102,8 +1102,7 @@ class Task(models.Model): if task.allow_task_dependencies: if task.is_blocked_by_dependences() and vals['state'] not in CLOSED_STATES and vals['state'] != '04_waiting_normal': task.state = '04_waiting_normal' - if vals['state'] in CLOSED_STATES: - task.date_last_stage_update = now + task.date_last_stage_update = now self._task_message_auto_subscribe_notify({task: task.user_ids - old_user_ids[task] - self.env.user for task in self}) return result