[FIX] hr_timesheet: fix display of empty allocated time in studio

This commit's purpose is to fix the display of the default field when
entering studio mode from a task form with no allocated time.

Step to reproduce :
-open project
-open office design
-create new task/select a task with 0 allocated hours
-open studio

the display of the field 'allocated time' is partially hidden by the
span 0%

Source of the bug:
the widget timesheet_uom_no_toggle has a max width of 7CH, which is too
little to allow the full display of the default name.

Solution:
Create and add a new scss class which is only active in studio mode.

Version affected:
saas-16.2 to master

task - 3553101
https://www.odoo.com/web#id=3553101&menu_id=4720&cids=1&action=333&active_id=4105&model=project.task&view_type=form

closes odoo/odoo#152159

X-original-commit: 30092f7a67579551ac3fb7a7d5668699cae8b3aa
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
damr
2024-02-01 16:25:43 +00:00
committed by Xavier Bol (xbo)
parent 70432d7052
commit 97429e557f
2 changed files with 5 additions and 1 deletions
@@ -1,3 +1,7 @@
.o_project_kanban .o_kanban_renderer .oe_kanban_align.badge {
color: inherit;
}
.o_web_studio_form_view_editor .o_field_widget.o_web_studio_widget_empty.o_task_planned_hours {
max-width: 70ch;
}
@@ -19,7 +19,7 @@
<field name="subtask_count" invisible="1"/>
<label for="allocated_hours" invisible="not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user"/>
<div class="text-nowrap" invisible="not allow_timesheets" groups="hr_timesheet.group_hr_timesheet_user">
<field name="allocated_hours" class="oe_inline o_field_float_time" widget="timesheet_uom_no_toggle"/>
<field name="allocated_hours" class="oe_inline o_field_float_time o_task_planned_hours" widget="timesheet_uom_no_toggle"/>
<span invisible="subtask_count == 0">
(incl. <field name="subtask_allocated_hours" nolabel="1" widget="timesheet_uom_no_toggle" class="oe_inline"/> on
<span class="fw-bold text-dark"> Sub-tasks</span>)