Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
8348 มุมมอง

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.        

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Here is the answer for you my friend;

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

Best regards.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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"/>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

For Odoo 12, here is the syntax.

<span t-field="employee_code" t-options='{"widget": "payment"}' />
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

In qweb report we use ,

<span t-field="doc.total_fine_amount"

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ค. 16
2930
1
ส.ค. 23
5607
4
พ.ย. 24
7459
0
ธ.ค. 18
3704
9
ก.พ. 17
5978