Skip to Content
Menu
This question has been flagged
2 Replies
890 Rodiniai

I have the problem that for all products with several lines of text in the description column of a rendered document like INV or SO, the other values of the other columns appear on the last line (bottom) instead on the first line. 

Idealy I'd like to only use xml to change it.

If possible I'd like to also reduce the spacing distance between these description lines of a product using CSS or style elements.
I am using Odoo 17

Help is appreciated.
Thanks.


Portretas
Atmesti
Best Answer

Hi Elias

For your first problem:

Ensure Top Alignment for Other Columns: Add the vertical-align: top; style to cells containing other column values, so they align with the first line of the description. Or use bootstarp call 

<span class="align-top">top</span>



For line space:

Reduce Line Spacing in Description: Use line-height to control the spacing between lines in the description column.

or use bootstarp
https://getbootstrap.com/docs/5.0/utilities/spacing/


here an example:

<!-- This is an example of a table row in the report template -->

<tr>

    <!-- Description Column -->

    <td style="line-height: 1.2; padding: 5px;"> <!-- Adjust '1.2' to control line spacing -->

        <span t-esc="line.description"/>

    </td>


    <!-- Other Columns with Top Alignment -->

    <td style="vertical-align: top; padding: 5px;">

        <span t-esc="line.product_uom_qty"/>

    </td>

    <td style="vertical-align: top; padding: 5px;">

        <span t-esc="line.price_unit"/>

    </td>

    <td style="vertical-align: top; padding: 5px;">

        <span t-esc="line.price_subtotal"/>

    </td>

</tr>


Portretas
Atmesti
Autorius Best Answer

much appreciated!
both solutions work.

Portretas
Atmesti