summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinal Patel <jip@odoo.com>2019-10-11 12:01:06 +0000
committerfw-bot <otis@odoo.com>2019-10-14 09:08:52 +0000
commit5288816baed88232eb3b0093fa3cc0330f21706a (patch)
tree8a1f0d8c4fd1b4bd7bc31e1bda3ac25e879c03e2
parent67a222cab6c13965b10852f5f45e296a6b57ab3c (diff)
[IMP] hr_timesheet: improve 'Timesheet Entries' Report
- If the Timesheet entries all belong to the same project, the report title should be "Timesheet Entries for the name of the project Project" and here in this case no need to show the project column. - Split the Project - Task column into two separate ones: one for the Project and one for the Task task-2027729 closes odoo/odoo#38684 X-original-commit: 96d3bd7560f43847c758d149eaab14ecc9206058 Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
-rw-r--r--addons/hr_timesheet/report/report_timesheet_templates.xml19
1 files changed, 13 insertions, 6 deletions
diff --git a/addons/hr_timesheet/report/report_timesheet_templates.xml b/addons/hr_timesheet/report/report_timesheet_templates.xml
index 01bdc3657de..20c7ad1b717 100644
--- a/addons/hr_timesheet/report/report_timesheet_templates.xml
+++ b/addons/hr_timesheet/report/report_timesheet_templates.xml
@@ -6,15 +6,19 @@
<t t-set="show_project" t-value="len(docs.mapped('project_id')) > 1"/>
<div class="page">
<div class="oe_structure"/>
- <div class="row">
+ <div class="row" style="margin-top:10px;">
<div class="col-lg-12">
<h2>
- <span>Timesheet Entries</span>
+ <span>Timesheet Entries
+ <t t-if="len(docs.mapped('project_id')) == 1">
+ for the <t t-esc="docs.mapped('project_id')[0].name"/> Project
+ </t>
+ </span>
</h2>
</div>
</div>
- <div class="row">
+ <div class="row" style="margin-top:10px;">
<div class="col-lg-12">
<table class="table table-sm">
<thead>
@@ -22,7 +26,8 @@
<th><span>Date</span></th>
<th><span>Responsible</span></th>
<th><span>Description</span></th>
- <th t-if="show_task"><t t-if="show_project">Project - </t>Task</th>
+ <th t-if="show_project">Project</th>
+ <th t-if="show_task">Task</th>
<th class="text-right"><span>Time</span></th>
</tr>
</thead>
@@ -37,9 +42,10 @@
<td >
<span t-field="l.name" t-options="{'widget': 'text'}"/>
</td>
+ <td t-if="show_project">
+ <span t-field="l.project_id.name"/>
+ </td>
<td t-if="show_task">
- <t t-if="show_project"><span t-field="l.project_id.name"/></t>
- <t t-if="show_project and l.task_id"> - </t>
<t t-if="l.task_id"><span t-field="l.task_id.name"/></t>
</td>
<td class="text-right">
@@ -49,6 +55,7 @@
<tr>
<td />
<td />
+ <td t-if="show_project"/>
<td t-if="show_task"/>
<td class="text-right"><strong>Total</strong></td>
<td class="text-right"><strong t-esc="sum(docs.mapped('unit_amount'))" t-options="{'widget': 'duration', 'digital': True, 'unit': 'hour', 'round': 'minute'}"/></td>