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

Hi,I have a integer field (0) but when i put value 10000 in it it will display it as 10,000 i want to display it without comma.I have selected number field because i need to select Max number from it and add 1 in Max number for new entry. Can any body help me how i can do it in ODOO 9.

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

The widget="char" works for me.

<field name="number" widget="char"/>

 

อวตาร
ละทิ้ง

I think the widget="char" is the best option since it works also in Odoo 17.
<field name="number" options="{'format': 0}" /> does not work in Odoo 17.

widget="char" only work in form view but not work in tree view

คำตอบที่ดีที่สุด

You can use the options attribute disable numeric formatting:

<field name="number" options="{'format': 0}" />
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This way will work across all the view types in V15.
<field name="id" widget="integer" options="{'format': 0}"/>

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

Its separator based on your language you can change/remove from Language.(To do : Setting > Translation > Your LANGUAGE and change/remove Thousand Separator)

อวตาร
ละทิ้ง
ผู้เขียน

Working but it affected all the float fields, I need this only a Integer field.

For only integer, there is no any direct way. You need to change framework code (probably in format.js file)

คำตอบที่ดีที่สุด

Normaly you can use

therefore you have to define "numberfield" inside the kanban tag






Attention! has no display="full" for automatic line breaks

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

On a Kanban (for example), you can do this:

<span t-esc="record.id.raw_value"/>
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Limit the number of digits in integer? แก้ไขแล้ว
4
ก.ค. 25
35005
Integer Field Converts Value to Zero แก้ไขแล้ว
1
มี.ค. 23
2265
0
พ.ย. 16
2425
increment integer for a field odoov11 แก้ไขแล้ว
1
พ.ค. 18
6000
0
ธ.ค. 24
923