From 642fb2e6dd1f0fc02428e5e6717f070598cb682c Mon Sep 17 00:00:00 2001 From: "Xavier BOL (xbo)" Date: Mon, 29 Mar 2021 16:28:33 +0200 Subject: [PATCH] [IMP] project,{hr,sale}_timesheet: review dropdown in project kanban card Before this commit, we add various buttons in the bottom of each card with a certain condition, the problem is the lack of place to display more and more information in each project kanban card. This commit reviews the dropdown menus in each project kanban card. Two sections is added one for another 'Views' to redirect to documents, timesheets, sales order and planning, for instance. And the last section for 'Reporting' like burndown chart. task-2458017 closes #68343 --- addons/hr_timesheet/views/project_views.xml | 13 +++-- addons/project/models/project.py | 7 +++ addons/project/views/project_views.xml | 49 +++++++++++++------ .../views/project_task_views.xml | 21 +++++--- 4 files changed, 62 insertions(+), 28 deletions(-) diff --git a/addons/hr_timesheet/views/project_views.xml b/addons/hr_timesheet/views/project_views.xml index f64423d05fa..58ec4745345 100644 --- a/addons/hr_timesheet/views/project_views.xml +++ b/addons/hr_timesheet/views/project_views.xml @@ -239,15 +239,14 @@ + - - -
- Timesheets -
-
+ + - + record.analytic_account_id.raw_value and !record.allow_timesheets.raw_value
diff --git a/addons/project/models/project.py b/addons/project/models/project.py index c895cd1c0ae..b757b36cfb5 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -495,6 +495,13 @@ class Project(models.Model): action_context.pop('group_by', None) return dict(action, context=action_context) + def action_view_tasks_analysis(self): + """ return the action to see the tasks analysis report of the project """ + action = self.env['ir.actions.act_window']._for_xml_id('project.action_project_task_user_tree') + action_context = ast.literal_eval(action['context']) if action['context'] else {} + action_context['search_default_project_id'] = self.id + return dict(action, context=action_context) + # --------------------------------------------------- # Business Methods # --------------------------------------------------- diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml index 036a726467c..a5ba8965a29 100644 --- a/addons/project/views/project_views.xml +++ b/addons/project/views/project_views.xml @@ -527,6 +527,7 @@ +
@@ -556,20 +557,45 @@
-