Skip to main content
iVentureTeam

account_tax_repartition_line_factor_percent

Tax distributions sometimes have to be a third of something. This widget keeps twelve decimals so the arithmetic survives, then hides the trailing zeros so the screen stays readable.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 27, 20266 min read
Technical nameaccount_tax_repartition_line_factor_percent
Field typesfloat
Viewslist, form
Moduleaccount, present wherever Invoicing or Accounting is installed
Used in core1 occurrence, the tax distribution lines on the tax configuration form in account
VersionsOdoo 20.0, Odoo 19.0, Odoo 18.0
No-code setupNo. Studio offers the plain decimal field; this variant is set in view XML
Alternativesfloat, monetary, percentage, float_without_trailing_zeros

What the tax factor field does

An Odoo tax does not simply produce one amount. It distributes that amount across accounts and tax grids through repartition lines, each carrying a percentage. Most of the time those percentages are round numbers: a hundred percent to one account, or fifty and fifty.

Sometimes they are not. Splitting a tax three ways gives thirty three point three recurring, and a percentage rounded to two decimals does not add back up to a hundred. On a tax report that mismatch is a real problem, so the underlying field keeps far more precision than an ordinary amount.

This widget is what makes that precision usable. It sets the field's displayed precision to twelve decimals, then strips the trailing zeros so a clean fifty percent does not appear as fifty followed by a wall of zeros. And when a user types an expression, it rounds the result to the same precision before saving, so what appears on screen is exactly what is stored.

What this means for your team

The reason to care is the tax report. Repartition percentages that do not sum exactly produce residual cents in tax grids, and those residuals are what an auditor or a tax office notices. Keeping twelve decimals is not perfectionism; it is what makes a three way split reconcile.

The display trimming matters for a different reason. A configuration screen that shows every value with twelve decimals is unreadable, and unreadable configuration screens get misconfigured. Showing fifty as fifty point zero zero and only extending when the value genuinely needs it keeps the common case clean while the uncommon case stays exact.

The practical advice for anyone setting up multi way tax distributions is to type the fraction rather than the decimal. The field accepts arithmetic, so entering the division directly gives the full precision, whereas typing thirty three point three three three by hand stops wherever your patience does.

Supported options in Odoo 19

The widget declares no options of its own. It spreads the float widget's descriptor, so the options below are inherited, with one difference: the number of decimals defaults to twelve here rather than to the field's own definition. Read from the widget's source and float_field.js, Odoo 19.0.

OptionTypeWhat it does
digitslistInherited from the float widget, but with a different default: twelve decimals instead of the field's own precision. Override it in the view if you genuinely need fewer.(default: [16, 12])
enable_formattingbooleanInherited. Set it to false to remove thousands separators and locale formatting from the displayed value.(default: true)
stepnumberInherited. Step of the number input's spinner when the field is rendered as a number input.
typestringInherited. Set to number to render a real HTML number input.
human_readablebooleanInherited. Compact display for large numbers. Meaningless on a percentage and best left alone here.(default: false)

The precision is a default, not a lock. Passing a digits option in the view overrides the twelve decimal default, and the rounding applied when parsing follows whatever precision is in effect. Lowering it will make a three way split stop adding up, which is the situation the widget exists to prevent.

Working examples

The core usage

<field name="factor_percent"
       widget="account_tax_repartition_line_factor_percent"/>

No options. The twelve decimal precision and the trimming come entirely from the widget.

Entering a fraction

# typed into the field
= 100/3
# stored and displayed as 33.333333333333

The base float widget evaluates the arithmetic; this widget rounds the result to the field's precision so the saved value matches the display.

Overriding the precision

<field name="factor_percent"
       widget="account_tax_repartition_line_factor_percent"
       options="{'digits': [16, 4]}"/>

Legal, because the twelve decimals are a default prop rather than a hard rule. Rarely a good idea on a repartition line.

Why the display never drops below two decimals

The trimming rule is more careful than it looks. The widget takes the formatted value, finds the run of digits at the end, and counts the trailing zeros in it. It then removes those zeros, but never more than the length of that digit run minus two. The effect is a floor of two decimals: fifty formats as fifty point zero zero rather than collapsing to a bare fifty, which keeps the column visually aligned with the other amounts on the form.

Values with no trailing zeros are returned untouched, and so are values whose formatted form ends in something other than a digit, so the rule degrades safely rather than mangling unusual formats.

The parsing override exists for a specific failure the source comment names outright. The base float widget lets a user type an expression, and the result of dividing one hundred by three is an irrational-looking float with far more digits than the field's precision. Without intervention the screen would show a rounded value while the database stored the unrounded one, and the two would disagree the next time anything summed them. The override rounds the parsed value to the field's own precision before it is written, so display and storage stay in step.

Everything else is the standard float widget: the same formatting, the same input handling, the same options. The subclass is thirty lines and changes two methods and one default.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. Behavior identical on the development branch; only the props syntax changes.
Odoo 19.0VerifiedVerified against the shipped source. Byte-identical to Odoo 18.
Odoo 18.0VerifiedFirst version. Same precision, trimming and rounding.
Odoo 17.0Not availableWidget does not exist. The field used the plain float widget.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. The widget arrived in Odoo 18 and the Odoo 18 and Odoo 19 files are byte-identical, so views carry over untouched. On Odoo 17 and earlier the repartition percentage used the plain float field, which means a database upgraded from 17 gains the precision handling automatically with the standard accounting views.

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.

No behavior change. The trimming rule, the rounding on parse and the twelve decimal default are all identical. The only difference is the migration to the new Owl props syntax, where the default precision becomes an optional prop with the same default value instead of a static default.

Common problems and fixes

SymptomCause and fix
Distributions do not add up to a hundredThe precision was lowered with a digits option, so a repeating fraction is being truncated. Remove the override and let the twelve decimal default apply.
The value shown differs from the value savedSomething bypassed the widget's parser, for example an import or an API write. Round to the field's precision on the writing side; the widget only governs what the user types.
Fifty percent shows as 50.00 rather than 50Intended. The trimming never removes the last two decimals, so columns stay aligned. Nothing to fix.
Typing an expression does nothingExpression input comes from the base float widget and needs the leading equals sign. Type = 100/3 rather than 100/3.
The column is very wideA value genuinely needs many decimals, so nothing is trimmed. Expected on repeating fractions. Widen the column or accept the wrap.
Missing widget errorThe accounting module is not installed in that database. Install Invoicing or Accounting, or use the plain float widget.

Tax factor field vs the alternatives

WidgetBest forKey difference
account_tax_repartition_line_factor_percentTax distribution percentages that must stay exact through divisionTwelve decimal default precision, trailing zeros trimmed to a two decimal floor, and typed arithmetic rounded on save
floatOrdinary decimal valuesUses the field's own precision and does not trim trailing zeros
monetaryAmounts of moneyCurrency aware, with the currency's own rounding
percentageRatios stored as a fraction of oneMultiplies for display and appends a percent sign
float_without_trailing_zerosDecimals that should read as short as possibleTrims all trailing zeros with no two decimal floor

Use the plain float widget for ordinary decimals and let the field's own digits setting govern. Reach for this variant only where a value has to survive division without losing exactness, which in practice means tax repartition. If the value is money rather than a ratio, the monetary widget is the right choice, because it brings the currency and its rounding with it.

Frequently asked questions

Why does the field keep twelve decimals?+
So that distributions which do not divide evenly, such as a three way split, stay exact. At two decimals the parts stop summing to a hundred and the tax report picks up residuals.
Why does fifty show as 50.00?+
The trimming rule removes trailing zeros but never the last two decimals, so the column stays aligned with the other amounts on the form.
Can I type a fraction into the field?+
Yes. The base float widget evaluates typed arithmetic when the entry starts with an equals sign, and this widget rounds the result to the field's precision before saving.
Does it support the usual float options?+
All of them, since it spreads the float widget's descriptor. The only difference is that the decimals default to twelve rather than to the field's own precision.
Which versions have it?+
Odoo 18 and later. Odoo 18 and 19 are byte-identical, and the development branch changes only the props syntax.

Tax setup that reconciles to the cent

Repartition lines, tax grids and the reports built on them are where a small configuration decision becomes a filing correction. We configure and verify Odoo tax setups per country, on versions 16 through 19.

Book a free consultation

How this page was produced

The twelve decimal default, the trailing zero trimming with its two decimal floor and the rounding applied when parsing were read from account_tax_repartition_line_factor_percent.js on the Odoo 19.0 branch, with the inherited behavior read from float_field.js in the same branch. The usage comes from account/views/account_tax_views.xml. Version coverage comes from the absence of the file on 16.0 and 17.0, a byte comparison with 18.0, and a full comparison against the public development branch. Spotted an error? Tell us and we will correct the page.