تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
898 أدوات العرض

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.

الصورة الرمزية
إهمال