Skip to main content
iVentureTeam

open_decimal_precision_button

A field that is not really a field: a button in a warning panel that throws away your unsaved currency change and sends you to the setting you actually wanted.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 27, 20265 min read
Technical nameopen_decimal_precision_button
Field typesany
Viewsform
Moduleaccount, present wherever Invoicing or Accounting is installed
Used in core1 occurrence, the rounding warning on the currency form in account
VersionsOdoo 20.0, Odoo 19.0
No-code setupNo. It is a bespoke button tied to one settings action
Alternativesdocumentation_link, upgrade_boolean, boolean

What the decimal precision button does

Odoo has two different things that look like the same setting. A currency has a rounding, which controls how amounts in that currency are rounded. The database has a decimal precision configuration, which controls how many decimals amounts carry everywhere. People who want the second one very often start editing the first.

The currency form catches that. When a user starts changing the rounding it shows a warning panel explaining that decimals are a database wide setting affecting invoices, taxes and reports, and offers a way through to the right screen. This widget is that way through.

It is registered as a field widget, but it renders a button and reads nothing. The field it is attached to exists only so the panel can be shown or hidden by an ordinary invisible expression. Clicking the button discards the currency record and opens the decimal precision settings.

What this means for your team

The order of operations is what makes this worth a page. The button discards before it navigates, which means the half-made rounding change is thrown away rather than left pending in a form the user has now walked away from. Without that, a user could return later, press save out of habit, and change a currency's rounding they had already decided not to change.

Changing decimal precision on a live database is one of the genuinely dangerous settings in Odoo. It affects stored amounts across every model, and lowering it after data exists loses information. The panel exists to slow that decision down, and the widget exists to make sure the detour does not leave a mess behind it.

Working examples

The core usage

<div>
  <p>You are changing decimals in your entire database,
     including invoices, tax amounts, accounting amounts,
     reports. This is probably not intended.</p>
  <field name="display_rounding_warning"
         widget="open_decimal_precision_button"/>
</div>

The field carries no meaning of its own here; the surrounding panel is shown or hidden by the record's warning flag.

Controlling when the button appears

<div invisible="not display_rounding_warning">
  <field name="display_rounding_warning"
         widget="open_decimal_precision_button"/>
</div>

Standard visibility handling. The widget itself has no conditional logic.

What it does on click

# in order:
await record.discard()          # unsaved changes are dropped
action.doAction("base.action_decimal_precision_form")

The discard is awaited before the action opens, so the form is clean by the time the user leaves it.

Not a field, and deliberately not a view button

There are only two things to say about this widget, and both are about what it is not.

It is not a field. Its props are the standard field props, but the component never reads the record's value for its own field. It uses the record only to call discard on it. That makes the field name it is attached to a placeholder, which is why core points it at the boolean that governs the warning panel's visibility.

It is not a view button either, even though that is what it looks like. A view button with a type of object or action would run through Odoo's button pipeline, which saves the record before executing. That is precisely the wrong behavior here: saving is the thing the panel is trying to prevent. Registering a field widget instead is what lets the click discard rather than save.

Everything else is one line each. The component takes the action service in setup, and the handler awaits the record discard, then opens the settings action by its external identifier. There is no confirmation dialog, so a user who clicks it loses the current edit without being asked, which is intentional given that the panel exists to stop that edit.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Byte-identical to Odoo 19 on the development branch.
Odoo 19.0VerifiedFirst version. Verified against the shipped source.
Odoo 18.0Not availableWidget does not exist, and neither does the warning panel.
Odoo 17.0Not availableWidget does not exist.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. The widget is new in Odoo 19, along with the warning panel it sits in. Databases upgraded from Odoo 18 gain both with the standard accounting views, and there is nothing to migrate.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The development branch is unstable and this can still change; we re-verify the page after release.

Byte-identical. The file on the development branch matches Odoo 19 exactly. The discard, the hardcoded action and the absence of options are all unchanged.

Common problems and fixes

SymptomCause and fix
My currency change was lostIntended. The button discards the record before opening the settings action. Make the rounding change first and save it, if that is genuinely what you wanted.
The button never appearsThe surrounding panel is hidden because the warning flag on the record is false. The panel shows when a rounding change is in progress; check the field's invisible expression in an inherited view.
Nothing happens on clickThe user lacks access to the decimal precision settings action. Grant the required administration rights, or reach the setting from the technical settings menu.
I want it to open a different screenThe action identifier is hardcoded with no option. Write your own copy of the widget with a different action.
It saves instead of discardingThe field was replaced with a view button in a customization, and view buttons save first. Restore the field widget; the discard behavior is the reason it is a field rather than a button.

Decimal precision button vs the alternatives

WidgetBest forKey difference
open_decimal_precision_buttonA warning panel that has to send the user elsewhere without savingA field widget that renders only a button, and discards the record before navigating
documentation_linkPointing at documentation from a formOpens a link and never touches the record
upgrade_booleanEnterprise upsell prompts on a settingIntercepts a toggle rather than offering navigation
booleanThe underlying flag, shown as a checkboxRenders the value the field actually holds

If you want a button on a form that runs server logic, use a view button, which saves first and is the right default. Use a field widget like this one only when the click must not save, which in practice means a warning panel offering an exit. And if the click should merely navigate without touching the record, a documentation link widget is lighter than either.

Frequently asked questions

What does open_decimal_precision_button do?+
It renders a button which, when clicked, discards the current record and then opens the decimal precision settings action. It reads no value from the field it is attached to.
Why does it discard my changes?+
Because the panel it lives in exists to stop a currency rounding change. Carrying an unsaved edit into another screen would leave it pending, and a later habitual save would apply the change the user had decided against.
Why is it a field widget rather than a button?+
Odoo's view buttons save the record before executing. That is exactly the wrong behavior here, so the click is implemented as a field widget instead.
Can I point it at a different action?+
No. The action identifier is written into the source with no option, so a different destination needs your own copy of the widget.
Which versions have it?+
Odoo 19 onwards, together with the warning panel it sits in. It is byte-identical on the Odoo 20 development branch.

One setting away from a database-wide rounding problem

Decimal precision, currency rounding and the reports that depend on both are easy to change and hard to undo once data exists. We review those settings before they cause a restatement, as part of Odoo Accounting work on 16 through 19.

Book a free consultation

How this page was produced

The discard-then-navigate sequence, the hardcoded action identifier and the absence of options and supported types were read from open_decimal_precision_btn.js on the Odoo 19.0 branch. The surrounding warning panel and its wording come from account/views/res_currency.xml in the same branch. Version coverage comes from the absence of the file on 16.0, 17.0 and 18.0, and a byte comparison against the public development branch. Spotted an error? Tell us and we will correct the page.