From 5fa4f4cc310b19c7bd9102d361b6658e5188f6f6 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 8 Feb 2018 14:54:17 +0100 Subject: [PATCH] [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 --- addons/project/models/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 31cc324057c..97478917b7d 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -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'