跳至內容
選單
此問題已被標幟
2 回覆
889 瀏覽次數

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.


頭像
捨棄
最佳答案

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>


頭像
捨棄
作者 最佳答案

much appreciated!
both solutions work.

頭像
捨棄