[IMP] project: display remaining hours on tasks
The remaining hours on a task are now displayed unless there are no planned hours defined. - Between 0 and 79%: green border - Between 80 and 100%: yellow border - Above 100%: red border closes odoo/odoo#41222 Taskid: 2150121 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
@@ -233,10 +233,14 @@
|
||||
<templates position="before">
|
||||
<field name="progress" />
|
||||
<field name="remaining_hours" />
|
||||
<field name="planned_hours" />
|
||||
</templates>
|
||||
<div class="oe_kanban_bottom_left" position="inside">
|
||||
<t t-if="record.progress.raw_value > 80 and record.progress.raw_value < 100">
|
||||
<div t-att-class="'oe_kanban_align badge badge-' + (record.progress.raw_value >= 99 ? 'danger': 'warning')" title="Remaining hours">
|
||||
<t t-if="record.planned_hours.raw_value > 0">
|
||||
<t t-set="badge" t-value="" t-if="record.progress.raw_value < 80"/>
|
||||
<t t-set="badge" t-value="'badge-warning'" t-if="record.progress.raw_value >= 80 and record.progress.raw_value <= 100"/>
|
||||
<t t-set="badge" t-value="'badge-danger'" t-if="record.remaining_hours.raw_value < 0"/>
|
||||
<div t-attf-class="oe_kanban_align badge {{ badge }}" title="Remaining hours">
|
||||
<field name="remaining_hours" widget="float_time" />
|
||||
</div>
|
||||
</t>
|
||||
|
||||
@@ -51,3 +51,17 @@
|
||||
max-width: 688px;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.o_kanban_project_tasks .badge {
|
||||
background: inherit;
|
||||
color: inherit;
|
||||
border: 1px solid var(--success);
|
||||
}
|
||||
|
||||
.o_kanban_project_tasks .badge-warning {
|
||||
border-color: var(--warning);
|
||||
}
|
||||
|
||||
.o_kanban_project_tasks .badge-danger {
|
||||
border-color: var(--danger);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user