diff options
| author | bit-odoo <bit@odoo.com> | 2021-01-29 10:30:08 +0000 |
|---|---|---|
| committer | bit-odoo <bit@odoo.com> | 2021-02-02 11:04:49 +0000 |
| commit | b13fc817d150f642254c4738cfbd91ac2ecaa65f (patch) | |
| tree | 3ee416b4b3e0e47dd95b974db765381a8937e27e /addons/project/models | |
| parent | 3b2a92ec05039ee87cb22794a592ee5c5ffc10fa (diff) | |
[FIX] project: filter when not required
Before this commit:
A method action_subtask is including the other actions context if have which
reflects while clicking on the Sub-tasks stat button. For examples:
- When click on the stat button 'Sub-tasks' of any task which one is clicked by
systray activity icon results
- When click on the task menu in project there a default search filter 'My task'
which also passes when click on 'sub tasks' stat button
After this commit:
Remove the context that startswith `search_default'.
Hence, now subtask will display with the correct context.
Task-2413127
closes odoo/odoo#65395
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/project/models')
| -rw-r--r-- | addons/project/models/project.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 42c3ca7bec6..bf1944d10d1 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -1374,6 +1374,7 @@ class Task(models.Model): else: default_project = self.project_id.subtask_project_id or self.project_id ctx = dict(self.env.context) + ctx = {k: v for k, v in ctx.items() if not k.startswith('search_default_')} ctx.update({ 'default_name': self.env.context.get('name', self.name) + ':', 'default_parent_id': self.id, # will give default subtask field in `default_get` |
