Skip to content

Commit

Permalink
[FIX] project: follow stage change
Browse files Browse the repository at this point in the history
- 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 odoo#22926
  • Loading branch information
nim-odoo authored and nle-odoo committed Feb 13, 2018
1 parent 34c52e9 commit 5fa4f4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/project/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def _track_subtype(self, init_values):
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'
Expand Down

0 comments on commit 5fa4f4c

Please sign in to comment.