Skip to main content
iVentureTeam

im_livechat.rating_percentage

Unusual entry in the widget inventory: im_livechat.rating_percentage is not a field widget at all. It is a formatter that turns Livechat's 1 to 5 rating scale into a 0 to 100 percentage inside pivot and graph reports.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 19, 2026Updated August 19, 20266 min read
Odoo 19 Livechat ratings pivot report showing the Rating (%) measure formatted as percentages by im_livechat.rating_percentage.
Technical nameim_livechat.rating_percentage
Field typesinteger, float (as a pivot/graph measure)
Viewspivot, graph
Moduleim_livechat (Livechat app)
Used in core6 occurrences across 1 module: the im_livechat channel report pivot and graph views
VersionsOdoo 19.0
No-code setupNo: measures in reports are wired in XML only
Alternativespercentage, percentpie, progressbar

What the rating percentage formatter does

Open Livechat's report on session ratings and you will see a Rating (%) measure showing values like 75 or 87.5. Under the hood, ratings are stored on a 1 to 5 scale. im_livechat.rating_percentage is the piece that converts one into the other, and it is a different animal from everything else in this widget encyclopedia.

The source file is seven lines. It registers a single function in registry.category("formatters"): take the value, subtract 1, clamp at zero, multiply by 100, divide by 4, round to one decimal. A rating of 1 (the minimum) becomes 0 percent, 3 becomes 50, 5 becomes 100.

Why does this show up in a widget list at all? Because pivot and graph views resolve the widget attribute on a measure against the formatters registry, not the field widgets registry. The same attribute name, a completely different lookup, which is why this "widget" works in reports but does nothing if you put it on a form field.

What this means for your team

The practical lesson for your own reporting is the pattern, not this specific formatter.

Averaging a 1 to 5 scale produces numbers like 4.2 that mean little to anyone outside the support team. Percentages are instantly readable in a management dashboard, and this is Odoo's own way of doing that conversion at display time rather than storing a duplicate percentage field. The stored data stays clean, the report stays readable, and there is no risk of the two drifting apart.

If your team scores anything on a scale, NPS-style surveys, supplier evaluations, quality checks, the same seven-line pattern gives you percentage measures in every pivot and graph without touching the database schema. It is one of the cheapest reporting wins we implement.

Working examples

How core uses it (pivot measure)

<field name="rating" string="Rating (%)" type="measure" widget="im_livechat.rating_percentage"/>

The same measure in a graph view

<field name="rating" string="Rating (%)" type="measure" widget="im_livechat.rating_percentage"/>

Roll your own formatter for any scale

// my_module/static/src/my_formatter.js
import { registry } from "@web/core/registry";

registry.category("formatters").add("my_module.score_percentage", (value) => {
    return Math.round((value / 10) * 100);
});

Then reference widget="my_module.score_percentage" on any pivot or graph measure. Prefix the name with your module to avoid registry collisions, exactly as core does here.

The formula, and why it subtracts one

The formula rewards a closer look: (max(value - 1, 0) * 100) / 4.

The - 1 and / 4 mean the scale is anchored at 1, not 0. Odoo's rating widget stores 1 for the worst rating and 5 for the best, so the usable range is 4 points wide, and a customer who rates 1 contributes exactly 0 percent, not 20. The max(..., 0) clamp exists because aggregated measures can average records with no rating into values below 1, which would otherwise produce negative percentages in the report.

The rounding line, Math.round((percentage + Number.EPSILON) * 10) / 10, keeps one decimal and uses the epsilon nudge to avoid the classic floating point half-down surprise on values like 87.35.

Because the function receives already-aggregated values, the conversion happens after averaging, not per record. Averaging 1-to-5 ratings and then rescaling is mathematically identical to rescaling first, so the numbers are sound; it just means you cannot use this formatter to change the aggregation itself.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentProvisional: the formatter file is deleted on the development branch while report views still reference it. See below.
Odoo 19.0VerifiedIntroduced in 19.0; verified against the shipped source.
Odoo 18.0Not availableDoes not exist; Livechat rating reports aggregate the raw 1 to 5 value.
Odoo 17.0Not availableDoes not exist.
Odoo 16.0Not availableDoes not exist.

Upgrade note. The formatter and the Rating (%) measures that use it are new in Odoo 19. In Odoo 18's Livechat reports the rating measure aggregates on the raw 1 to 5 scale, so dashboards built on those reports will show different numbers after an upgrade: same data, new unit.

What is changing in Odoo 20

Odoo 20 is expected at Odoo Experience in Brussels, 24 to 26 September 2026. The notes below are read from the public development branch and are not final until release.

The formatter file is currently deleted on master, and we could not find the registration re-added anywhere else in the im_livechat module, while the channel report XML still references widget="im_livechat.rating_percentage" in three places. On the development branch as it stands, those measures would fall back to default number formatting. That is the kind of inconsistency that usually gets resolved before release, either by restoring the formatter or rewriting the report, so treat the 20.0 row in the version table as provisional. We re-verify this page against the shipped release.

Common problems and fixes

SymptomCause and fix
Using it on a form or list field shows a missing widget warningIt lives in the formatters registry; form and list views look up the field widgets registry. Only reference it on pivot or graph measures. On form fields, use a computed percentage field with the percentage widget instead.
The percentage looks lower than expectedThe scale is anchored at 1: a 1-star rating is 0 percent, not 20 percent, because the formula divides the 4-point usable range. Nothing to fix; that is the intended mapping of Odoo's 1 to 5 rating scale.
Your own custom formatter never gets picked upThe JavaScript file is not in the module's web.assets_backend bundle, or the registry name collides with an existing one. Add the file to the assets bundle in __manifest__.py and prefix the formatter name with your module name.
Numbers changed after upgrading to Odoo 19The Livechat rating measure switched from the raw 1 to 5 average to this percentage conversion. Update any external dashboards or exports that consumed the old scale; the underlying stored data is unchanged.

Rating percentage formatter vs the alternatives

WidgetBest forKey difference
im_livechat.rating_percentageShowing Livechat's 1 to 5 ratings as percentages in reportsA formatters-registry function, not a field widget: display-time conversion only
percentageFields that already store a percentage or fractionA real field widget with a percent sign; editable on forms
percentpieA 0 to 100 value as a visual gaugeDraws a circular pie instead of reformatting a report measure
progressbarProgress toward a target with an optional max fieldHorizontal bar in forms and lists, not a report formatter

For stored fields that already hold 0 to 100 values, skip the custom formatter: percentage formats plain numbers with a percent sign, and percentpie draws them as a gauge. This formatter exists specifically for the 1 to 5 rating scale.

Frequently asked questions

Is im_livechat.rating_percentage a field widget?+
No. It is registered in registry.category("formatters"), which pivot and graph views consult for the widget attribute on measures. Form and list views consult the fields registry, where this name does not exist.
How does Odoo convert a 1 to 5 rating to a percentage?+
With the formula (max(value - 1, 0) * 100) / 4, rounded to one decimal. So 1 star is 0 percent, 3 stars is 50, and 5 stars is 100. The subtraction anchors the scale at the minimum rating of 1.
Can I use this formatter on my own model's ratings?+
Yes, if your field uses the same 1 to 5 scale and the im_livechat module is installed: set widget="im_livechat.rating_percentage" on your pivot or graph measure. For other scales, register your own seven-line formatter instead of depending on Livechat.
Why is a rating of 1 shown as 0 percent and not 20 percent?+
Because 1 is the minimum of Odoo's rating scale; the formula measures where the value sits within the 4-point range between 1 and 5. The worst possible rating maps to 0 by design.
Does the conversion change what is stored in the database?+
No. The rating stays stored on the 1 to 5 scale; the formatter converts it at display time only, so exports of the raw field still show the original values.

Reports your managers actually read?

A seven-line formatter turned Livechat's rating average into a percentage everyone understands. We build the same kind of small, surgical reporting improvements across Odoo: custom measures, readable units, pivot and graph views tuned to how your team makes decisions.

Sharpen our Odoo reporting

How this page was produced

The behavior on this page was read from rating_percentage_widget.js on the Odoo 19.0 branch, all seven lines of it, together with the im_livechat channel report views that reference it. Its absence in 18.0 and its deletion on the development branch were both confirmed by checking the same paths on those branches, including a search of the module for a relocated registration. Spotted an error or a version difference? Tell us and we will correct the page.