Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4613 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you very much Fathi. It is working.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 16
4488
1
thg 6 15
4378
0
thg 3 15
3761
Decimal precision Đã xử lý
3
thg 6 24
50740
1
thg 2 25
894