[FIX] project, project_issue: in project dashboard, boxes are visible even if 0 (ex: tasks and issues)

This commit is contained in:
Martin Geubelle
2015-05-29 10:44:52 +02:00
parent 328d62cc91
commit 38d114a2fb
5 changed files with 43 additions and 6 deletions
+3 -3
View File
@@ -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>
@@ -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>
@@ -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;
}
}
}
}
+2 -2
View File
@@ -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>
@@ -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"/>