diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 2b9029c0cd1..08a02a73717 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -362,11 +362,10 @@ class Project(models.Model): not_fav_projects.write({'favorite_user_ids': [(4, self.env.uid)]}) favorite_projects.write({'favorite_user_ids': [(3, self.env.uid)]}) - def open_tasks(self): - ctx = dict(self._context) - ctx.update({'search_default_project_id': self.id}) - action = self.env['ir.actions.act_window'].for_xml_id('project', 'act_project_project_2_project_task_all') - return dict(action, context=ctx) + def action_view_tasks(self): + action = self.with_context(active_id=self.id, active_ids=self.ids).env.ref('project.act_project_project_2_project_task_all').read()[0] + action['display_name'] = self.name + return action def action_view_account_analytic_line(self): """ return the action to see all the analytic lines of the project's analytic account """ diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index d05a8fd48d2..a305f1e6e8c 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -57,9 +57,9 @@ Tasks project.task kanban,tree,form,calendar,pivot,graph,activity + [('project_id', '=', active_id)] { 'pivot_row_groupby': ['user_id'], - 'search_default_project_id': [active_id], 'default_project_id': active_id, } @@ -293,7 +293,7 @@
-
@@ -375,7 +375,7 @@