Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
539 Zobrazení

Hello Odoo experts 👋

  • I have a custom float field (e.g., price or rate)
  • I want it to display values with 3 decimal places, like 0.000
  • There is no Create button on the form — I’m just trying to change how an existing float field is displayed in the UI

Thanks in advance !

Avatar
Zrušit
Nejlepší odpověď

Hi,


You can define the decimal precision while defining the field.

Try with the following code.

exchange_rate = fields.Float(string='Exchange.Rate', digits=(16, 3))

* You can change the precision from the UI.

Change the XML as 

<field name="field_name" digits="[3,3]"/>



Hope it helps

Avatar
Zrušit
Autor

Will it work with monetary field type ?

Related Posts Odpovědi Zobrazení Aktivita
1
čvn 25
788
1
čvn 25
726
0
lis 24
1045
2
čvc 25
393
0
říj 24
909