summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Baranx (bar) <bar@odoo.com>2020-02-24 15:06:04 +0000
committerYannick Tivisse <yti@odoo.com>2020-03-02 15:56:16 +0000
commit01412dd7d99e65885f240c4ba5e4b8de21c44fa2 (patch)
tree42134be3e6f5ab5b777d95329b0d4d1a07fd3c0a
parenteff7885e0d04047371a6931ab84362c84df545a5 (diff)
[IMP] project: Hide negative hours in project overview
Purpose ======= Negative hours take the whole space in the 'time by people' section. This is misleading because, visually, it looks like that employee timesheeted as much time as his colleagues. Specifications ============== Project overview > time by people section: exclude negative hours from the 'colored bar' closes odoo/odoo#46226 Taskid: 2201980 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
-rw-r--r--addons/sale_timesheet/views/hr_timesheet_templates.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/sale_timesheet/views/hr_timesheet_templates.xml b/addons/sale_timesheet/views/hr_timesheet_templates.xml
index ecc46c7f6e7..45fd6bcd408 100644
--- a/addons/sale_timesheet/views/hr_timesheet_templates.xml
+++ b/addons/sale_timesheet/views/hr_timesheet_templates.xml
@@ -243,11 +243,11 @@
<t t-esc="employee['employee_name']"/>
</a>
</td>
- <td style="width: 10%">
+ <td class="text-right pr-5" style="width: 10%">
<t t-esc="employee['total']" t-options="{'widget': 'float_time'}"/>
</td>
<td>
- <div t-if="repartition_employee_max" class="progress" t-attf-style="width: {{employee['total'] / repartition_employee_max * 100}}%">
+ <div t-if="repartition_employee_max" class="progress" t-attf-style="width: {{max(0, employee['total'] / repartition_employee_max * 100)}}%">
<t t-set="total" t-value="employee['total'] or 1.0" />
<t t-call="sale_timesheet.progressbar">
@@ -385,7 +385,7 @@
<template id="progressbar" name="project overview progressbar segments">
<t t-set="amount" t-value="employee[key]"/>
- <t t-if="amount">
+ <t t-if="amount &gt; 0">
<t t-set="title"><t t-esc="label"/>: <t t-esc="amount" t-options="{'widget': 'float_time'}"/></t>
<a t-attf-class="progress-bar o_progress_{{key}}"
t-attf-style="width: {{amount / total * 100}}%"