From 38d114a2fbae10612970873b54426fd211f3c836 Mon Sep 17 00:00:00 2001 From: Martin Geubelle <mge@odoo.com> Date: Fri, 29 May 2015 10:25:47 +0200 Subject: [PATCH] [FIX] project, project_issue: in project dashboard, boxes are visible even if 0 (ex: tasks and issues) --- addons/project/project_dashboard.xml | 6 +++--- addons/project/report/project_report_view.xml | 16 ++++++++++++++++ .../static/src/less/project_dashboard.less | 5 ++++- addons/project_issue/project_dashboard.xml | 4 ++-- .../report/project_issue_report_view.xml | 18 ++++++++++++++++++ 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/addons/project/project_dashboard.xml b/addons/project/project_dashboard.xml index 3d54eb456219..1e5ccbd13bcd 100644 --- a/addons/project/project_dashboard.xml +++ b/addons/project/project_dashboard.xml @@ -36,13 +36,13 @@ <a type="edit">Settings</a> </div> <div> - <a name="%(dblc_proj)d" type="action">Tasks</a> + <a name="%(action_project_task_user_tree_filtered)d" type="action">Tasks</a> </div> <div> <a name="%(action_view_task_history_cumulative_filter)d" type="action">Cumulative Flow</a> </div> </div> - <div t-if="widget.view.is_action_enabled('edit')" class="o_kanban_card_manage_settings"> + <div t-if="widget.view.is_action_enabled('edit')" class="o_project_kanban_colorpicker"> <div class="col-xs-12"> <li><ul class="oe_kanban_colorpicker" data-field="color"/></li> </div> @@ -56,7 +56,7 @@ </div> <div class="o_project_kanban_boxes"> - <a t-if="record.use_tasks.raw_value and record.task_count.raw_value" class="o_project_kanban_box" name="%(act_project_project_2_project_task_all)d" type="action"> + <a t-if="record.use_tasks.raw_value" class="o_project_kanban_box" name="%(act_project_project_2_project_task_all)d" type="action"> <span class="o_value"><t t-esc="record.task_count.value"/></span> <span class="o_label"><t t-esc="record.label_tasks.value"/></span> </a> diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml index 5b52190aeb0a..c6544c3d7d4a 100644 --- a/addons/project/report/project_report_view.xml +++ b/addons/project/report/project_report_view.xml @@ -91,6 +91,22 @@ <field name="help">This report allows you to analyse the performance of your projects and users. You can analyse the quantities of tasks, the hours spent compared to the planned hours, the average number of days to open or close a task, etc.</field> </record> + <record id="action_project_task_user_tree_filtered" model="ir.actions.act_window"> + <field name="name">Tasks Analysis</field> + <field name="res_model">report.project.task.user</field> + <field name="view_type">form</field> + <field name="view_mode">pivot,graph</field> + <field name="search_view_id" ref="view_task_project_user_search"/> + <field name="context">{ + 'group_by_no_leaf':1, + 'group_by':[], + 'search_default_project_id': [active_id], + 'default_project_id': active_id, + } + </field> + <field name="help">This report allows you to analyse the performance of your projects and users. You can analyse the quantities of tasks, the hours spent compared to the planned hours, the average number of days to open or close a task, etc.</field> + </record> + <menuitem name="Tasks" action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/> </data> diff --git a/addons/project/static/src/less/project_dashboard.less b/addons/project/static/src/less/project_dashboard.less index 11d3b4689032..9ce363aea0a3 100644 --- a/addons/project/static/src/less/project_dashboard.less +++ b/addons/project/static/src/less/project_dashboard.less @@ -33,6 +33,9 @@ margin-left: 10px; margin-bottom: 10px; } + .o_project_kanban_colorpicker { + padding: 8px; + } .o_kanban_card_manage_pane { border-color: lightgrey; border-bottom-style: solid; @@ -77,4 +80,4 @@ background-color: @odoo-brand-optional; } } -} \ No newline at end of file +} diff --git a/addons/project_issue/project_dashboard.xml b/addons/project_issue/project_dashboard.xml index ef496ed5c81c..b49836219e97 100644 --- a/addons/project_issue/project_dashboard.xml +++ b/addons/project_issue/project_dashboard.xml @@ -9,7 +9,7 @@ <field name="issue_ids" invisible="1"/> </field> <xpath expr="//div[contains(@class, 'o_project_kanban_boxes')]" position="inside"> - <a t-if="record.use_issues.raw_value and record.issue_ids.raw_value.length > 0" class="o_project_kanban_box" name="%(act_project_project_2_project_issue_all)d" type="action"> + <a t-if="record.use_issues.raw_value" class="o_project_kanban_box" name="%(act_project_project_2_project_issue_all)d" type="action"> <span class="o_value"><t t-raw="record.issue_ids.raw_value.length"/></span> <span class="o_label"><field name="label_issues"/></span> </a> @@ -17,7 +17,7 @@ <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> <div> - <a name="%(action_project_issue_report)d" type="action">Issues</a> + <a name="%(action_project_issue_report_filtered)d" type="action">Issues</a> </div> </xpath> diff --git a/addons/project_issue/report/project_issue_report_view.xml b/addons/project_issue/report/project_issue_report_view.xml index df56c466abaf..5c8b58f86197 100644 --- a/addons/project_issue/report/project_issue_report_view.xml +++ b/addons/project_issue/report/project_issue_report_view.xml @@ -75,6 +75,24 @@ <field name="help">This report on the project issues allows you to analyse the quality of your support or after-sales services. You can track the issues per age. You can analyse the time required to open or close an issue, the number of email to exchange and the time spent on average by issues.</field> </record> + <record id="action_project_issue_report_filtered" model="ir.actions.act_window"> + <field name="name">Issues Analysis</field> + <field name="res_model">project.issue.report</field> + <field name="view_type">form</field> + <field name="view_mode">pivot,graph</field> + <field name="context">{ + 'search_default_year':1, + 'search_default_This Month':1, + 'search_default_project':1, + 'search_default_project_id': [active_id], + 'default_project_id': active_id, + } + </field> + <field name="search_view_id" ref="view_project_issue_report_filter"/> + <field name="view_id"></field> <!-- force empty --> + <field name="help">This report on the project issues allows you to analyse the quality of your support or after-sales services. You can track the issues per age. You can analyse the time required to open or close an issue, the number of email to exchange and the time spent on average by issues.</field> + </record> + <menuitem action="action_project_issue_report" id="menu_project_issue_report_tree" parent="base.menu_project_report"/> -- GitLab