[FIX] project: follow stage change

- Create a project and a task
- Add a channel as follow of the project and task
- Set the channel to follow task stage change only

When changing the stage, the tracking is sometimes received in the
channel, sometimes it is not.

In the case of a stage change, the subtype returned for tracking depends
on the stage sequence. If the sequence is `<= 1`, the subtype for task
creation is returned. Therefore, if the channel is not following task
creation, the tracking message might or might not appear, depending on
the which stage is impacted.

We can remove this specific case, since the creation will be handled
when `user_id` is in the `init_values` or when `mail_create_nolog` is in
the context.

opw-802924
closes #22926
This commit is contained in:
Nicolas Martinelli
2018-02-13 17:38:25 +01:00
committed by Nicolas Lempereur
parent 34c52e9938
commit 5fa4f4cc31
+1 -1
View File
@@ -721,7 +721,7 @@ class Task(models.Model):
return 'project.mt_task_ready'
elif 'user_id' in init_values and self.user_id: # assigned -> new
return 'project.mt_task_new'
elif 'stage_id' in init_values and self.stage_id and self.stage_id.sequence <= 1: # start stage -> new
elif self.env.context.get('mail_create_nolog'): # task created
return 'project.mt_task_new'
elif 'stage_id' in init_values:
return 'project.mt_task_stage'