Odoo 16 Float Field default value

165 views Asked by At

I have a Float field:

    ​field_name = fields.Float(string='The percentage paid upon signing the contract', default=6.7)

When I apply this, it shown as 670

same for default=50.0 ---> 5000

25.5 ---> 2550

I want to show the default value as 6.7 and 50.0 and 25.5

How could I do this .. thanks!

1

There are 1 answers

0
Ahrimann On

Add the digits attribute to your field definition:

field_name = fields.Float(string='percentage paid...', default=6.7, digits=[1, 1])

and check if you use a widget in xml too.