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

Hello everybody!!!

My friends, i am printing some reports.

But, the problem is that i have some fields type float. So, when i print my reports i get comma.

I want to eliminate the comma without multiplying the number.

So, i there any way except multiplying the number or changing the field from integer to char.

Need an answer firends.

Thanks a lot in advance.

Best Regards.        

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

Here is the answer for you my friend;

      <span t-esc="'%.0f'%company.cnss"/>

Best regards.

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

use in case if you are trying in form or tree 

widget="payment"

example

in py

class sample(models.Model):   

         _name="module.sample"

         integer_field = fields.Integer()

in xml

<field name="integer_field" widget="payment"/>
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

For Odoo 12, here is the syntax.

<span t-field="employee_code" t-options='{"widget": "payment"}' />
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

In qweb report we use ,

<span t-field="doc.total_fine_amount"

              t-field-options='{"widget": "payment"/>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 16
2811
1
thg 8 23
5191
4
thg 11 24
7213
0
thg 12 18
3562
9
thg 2 17
5808