[FIX] project: fix the width of state and priority columns in list view

Before this commit, when the list view is rendered and is empty then
the state and priority columns are relatively big just to display a
button.

This commit fixes the width of those columns to 40px when the list
view is empty. If the list view is not empty then those columns will
have a min-width set to 40px.

task-3248592

closes odoo/odoo#120508

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
Xavier Bol (xbo)
2023-05-12 19:54:50 +02:00
parent 96c11f3e9c
commit 8a286e89cc
+7 -7
View File
@@ -379,8 +379,8 @@
<field name="allow_milestones" invisible="1"/>
<field name="sequence" widget="handle"/>
<field name="id" optional="hide"/>
<field name="priority" widget="priority" nolabel="1" options="{'autosave': False}"/>
<field name="state" widget="project_task_state_selection" nolabel="1" options="{'hide_label': 1, 'autosave': False}"/>
<field name="priority" widget="priority" nolabel="1" options="{'autosave': False}" width="40px"/>
<field name="state" widget="project_task_state_selection" nolabel="1" options="{'hide_label': 1, 'autosave': False}" width="40px"/>
<field name="name" widget="name_with_subtask_count"/>
<field name="subtask_count" invisible="1"/>
<field name="closed_subtask_count" invisible="1"/>
@@ -417,8 +417,8 @@
<field name="subtask_count" invisible="1"/>
<field name="closed_subtask_count" invisible="1"/>
<field name="id" optional="hide"/>
<field name="priority" widget="priority" nolabel="1" options="{'autosave': False}"/>
<field name="state" widget="project_task_state_selection" nolabel="1" options="{'autosave': False}"/>
<field name="priority" widget="priority" nolabel="1" options="{'autosave': False}" width="40px"/>
<field name="state" widget="project_task_state_selection" nolabel="1" options="{'autosave': False}" width="40px"/>
<field name="name" widget="name_with_subtask_count"/>
<field name="project_id" optional="hide" options="{'no_open': 1}" />
<field name="milestone_id"
@@ -496,10 +496,10 @@
<form class="o_form_project_tasks">
<group>
<field name="display_name" string= "Task Title" placeholder="e.g. Send Invitations" required="1"/>
<field name="project_id"
<field name="project_id"
widget="project_private_task"
invisible="context.get('default_project_id', False)"
placeholder="Private"
invisible="context.get('default_project_id', False)"
placeholder="Private"
class="o_project_task_project_field"
domain="[('type_ids', 'in', context['default_stage_id'])] if context.get('default_stage_id') else []"
context="{'default_type_ids': [(4, context.get('default_stage_id', False))]}"