From edf04f317c2f1abcaed5deb178777cb5b40d0112 Mon Sep 17 00:00:00 2001 From: Vishnu Thuletiya Date: Wed, 27 Nov 2019 06:11:46 +0000 Subject: [PATCH] [IMP] project: improve the project kanban and task breadcrumb Purpose of the task is, when some one remove the default filter at that time kanban view is really a mess so when go though the project always apply the domain of current project instead of filter. The breadcrumb should be the name of the project instead of name of the action(tasks) so pass display_name from method to change the breadcrum when view the task from kanban view. closes odoo/odoo#40922 Task: 2124377 Closes: #40922 Related: odoo/enterprise#6903 Signed-off-by: Yannick Tivisse (yti) --- addons/project/models/project.py | 9 ++++----- addons/project/views/project_views.xml | 6 +++--- addons/sale_timesheet/models/sale_order.py | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) 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 @@