Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4615 Переглядів

Hi,

When i print a PDF quotation in sales, i see 1 Piece like 1,000. Decimal accuracy is 3. I want to do as follow;

a) 1,000 to set 1

b)1,510 to set 1,51

c)1,500 to set 1,5

d) 1,511 to set 1,511

In sales report i find following row;

<td name="td_quantity" class="text-right">
<span t-field="line.product_uom_qty"/>
<span t-field="line.product_uom" groups="uom.group_uom"/>
</td>

Thanks

Аватар
Відмінити
Найкраща відповідь

You can use python formatting in xml like so:

<span t-esc="'{0:g}'.format(line.product_uom_qty)"/>

or any other python formatting that controls padding like '%.2f'%(line.product_uom_qty )
which shows 2 decimal points


Аватар
Відмінити
Автор

Thank you very much Fathi. It is working.

Related Posts Відповіді Переглядів Дія
1
квіт. 16
4493
1
черв. 15
4379
0
бер. 15
3763
Decimal precision Вирішено
3
черв. 24
50740
1
лют. 25
895