[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
This commit is contained in:
Vincent Larcin
2023-09-05 18:44:23 +00:00
parent b038bbfad4
commit fef29c62f5
+1 -2
View File
@@ -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