[IMP] project, hr_timesheet: improve UX

- Description:
    - project: Apply default filters when selecting a 'blocked by'
    task in task form (project.task form view > blocked by notebook >
    add a line > apply a default filter on the current project and on
    open tasks)
    - project, hr_timesheet: uniformize remaining hours display in
    kanban view for tasks and projects (project.project kanban view:
    add a frame around remaining hours. The color of the frame follows
    the same rules as the one used in project.task kanban view)

task-3034806

closes odoo/odoo#104250

Related: odoo/enterprise#33309
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
Hugo Carlier (Huca)
2022-11-28 14:50:50 +01:00
parent 0340537152
commit fb13d7c99e
3 changed files with 5 additions and 3 deletions
+2 -1
View File
@@ -308,7 +308,8 @@
</xpath>
<xpath expr="//div[hasclass('o_project_kanban_boxes')]" position="after">
<t t-set="badgeColor" t-value="'border-success'"/>
<t t-set="badgeColor" t-value="'border-danger'" t-if="record.remaining_hours.raw_value &lt; 0"/>
<t t-set="badgeColor" t-value="'border-warning'" t-if="record.remaining_hours.raw_value / record.allocated_hours.raw_value &lt; 0.2 and record.remaining_hours.raw_value / record.allocated_hours.raw_value &gt; 0"/>
<t t-set="badgeColor" t-value="'border-danger'" t-elif="record.remaining_hours.raw_value &lt; 0"/>
<t t-set="title" t-value="'Remaining days'" t-if="record.encode_uom_in_days.raw_value"/>
<t t-set="title" t-value="'Remaining hours'" t-else=""/>
<div t-if="record.allocated_hours.raw_value &gt; 0"
+1 -1
View File
@@ -1,4 +1,4 @@
.o_kanban_project_tasks .oe_kanban_align.badge {
.o_kanban_project_tasks .oe_kanban_align.badge, .o_project_kanban .oe_kanban_align.badge {
background: inherit;
color: inherit;
border: 1px solid var(--success);
+2 -1
View File
@@ -1239,7 +1239,8 @@
</field>
</page>
<page name="task_dependencies" string="Blocked By" attrs="{'invisible': [('allow_task_dependencies', '=', False)]}" groups="project.group_project_task_dependencies">
<field name="depend_on_ids" nolabel="1" context="{'default_project_id' : project_id}">
<field name="depend_on_ids" nolabel="1"
context="{'default_project_id' : project_id, 'search_view_ref' : 'project.view_task_search_form_extended', 'search_default_display_project_id': project_id, 'search_default_open_tasks': 1}">
<tree editable="bottom" decoration-muted="is_closed == True">
<field name="allow_milestones" invisible="1"/>
<field name="parent_id" invisible="1" />