How to show float number without decimal points in odoo

539 views Asked by At

As I am using Odoo online, the ways can be used maybe limited. I have tried using widget="integer" but seems it doesn't work on float type field. I have tried digits = "[12,0]" but it doens't seem to work either.

The field is quantity in sales.order.line which has a field type of float.

1

There are 1 answers

0
Dan On

As Czoellner says in the comments, you can configure the decimal precision for some fields in the technical settings (Settings/technical/Database Structure/Decimal Accuracy) using debug mode.

You can set the precision for:

  • Product Price
  • Discount
  • Stock Weight
  • Volume
  • Product Unit of Measure
  • Payment Terms

The one for quantities is "Product Unit of Measure" and you can change the precision to '0'. But, since Odoo automatically changes the quantity according to the UoM, you should have to change the precision for every UoM to '0'.

You can develop more precision configurations for other fields but you have no create an app for it to work on existing fields.

NOTE: This change affects every form in Odoo that uses quantities, not one specific form. To change a specific form, you have to do it through development.