[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user