OdooWiki OCA HUB

Web Widget UoM

web_widget_uom folder_open OCA/web open_in_new
web License: AGPL-3

This module allows the user to decide maximum how many decimal places should be displayed in the Odoo User Interface for each Unit of Measure.

If "Show only inputed decimals" is enabled on the UoM, the widget will show inputed decimals up to Decimal Places.

auto_awesome What this module does

AI-generated from the code · Odoo 14.0

Lets you set, per unit of measure, how many decimal places Odoo shows for quantities, and optionally display only the decimals you actually typed.

This module adds two settings to every unit of measure (UoM) in Odoo, so you can control how quantities are displayed in the user interface.

  • On the UoM form and list you get a "Decimal Places" number (default 2) and a "Show only inputed decimals" checkbox.
  • If "Show only inputed decimals" is ticked, quantity fields show only the decimals you entered, but never more than the Decimal Places value. For example, with Decimal Places 2, typing 1.5 shows 1.5, while typing 1.50 shows 1.50.
  • A warning appears if you set Decimal Places higher than Odoo's Decimal Accuracy for Product Unit of Measure, because that can cause calculation inconsistencies.
  • Decimal Places cannot be negative; Odoo blocks saving a negative value.

The settings are visible on the Units of Measure screen (form and list views). The module also changes how quantity fields are displayed in the backend interface, using the UoM linked to the line to decide the number of decimals. It touches the uom.uom model and the quantity fields that reference a unit of measure, such as product_uom_qty.

Depends on

webuomproduct
Models and fields (1)
  • uom.uom · extends an existing modeldecimal_places (Decimal Places), show_only_inputed_decimals (Show only inputed decimals)

Text generated by AI (DeepSeek) from reading the Odoo 14.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 1 confirmed, 8 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 14.0

In the UoM form view specify the number of decimal places that should be displayed for each unit of Measure:

In the view declaration, put widget='uom' attribute in the field tag:

...
<field name="arch" type="xml">
    <tree string="View name">
        ...
        <field name="product_qty" widget="uom"/>
        ...
    </tree>
</field>
...
<field name="arch" type="xml">
    <form string="View name">
        ...
        <field name="product_qty" widget="uom"/>
        ...
    </form>
</field>
...

Widget Options:

...
<field name="arch" type="xml">
    <tree string="View name">
        ...
        <field name="product_qty" widget="uom" options="{'uom_field': 'product_uom'}"/>
        ...
    </tree>
</field>
...

If the UoM field in the model is not declared under the name uom_id, the option uom_field must be specified with the appropriate field name.

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.