From c2d20902f6cfaee1605f56e97cbdc32056a08b1f Mon Sep 17 00:00:00 2001 From: bit-odoo Date: Fri, 29 Jan 2021 10:30:08 +0000 Subject: [PATCH] [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#66401 X-original-commit: b13fc817d150f642254c4738cfbd91ac2ecaa65f Signed-off-by: Yannick Tivisse (yti) --- addons/project/models/project.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/project/models/project.py b/addons/project/models/project.py index dbefa4a0919..405aa7d1443 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -1377,6 +1377,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`