[IMP] reference/user_interface: adapt list width attr doc

This commit rewrittes the documentation of the `width` attribute
in list views, following recent changes [1]

[1] odoo/odoo#170511

closes odoo/documentation#10160

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Aaron Bohy 2024-07-11 16:55:44 +02:00
parent 04aacf8863
commit 63789b0aa7

View File

@ -1415,11 +1415,15 @@ The `field` element can have the following attributes:
.. attribute:: width
:noindex:
The width to apply to the field's column when there are no records in the list, as an absolute
width (e.g., `100px`).
.. important::
The width is set by the webclient when there are records in the list.
The list view always tries to optimize the available space among columns. For some field types,
this is done by enforcing a width, depending on the field type. For instance, we know exactly the
number of pixels required to display a date, so we can ensure that a column for a date field
doesn't take more space than what is strictly necessary, thus leaving the extra space for the
other columns. However, the framework can't guess the adequate width for every field types. For
instance, char fields can be used to encode large values, or 3-letter country codes. In the
latter case, one can set the width directly in the arch (e.g. `width="40px"`). It represents
the width (always in pixels) required to render the values inside the cells. The width of the
column will then be the sum of the given value and the cells' left and right paddings.
:requirement: Optional
:type: str