Skip to main content
iVentureTeam

contact_statistics

The contact_statistics widget renders a json field as a read-only list of statistics. It exists for one screen, the contact form, and it takes no configuration at all.

September 18, 2026Updated September 18, 20263 min read
Technical namecontact_statistics
Field typesjson
Viewsform
Moduleweb, present in every Odoo database
Used in core2 uses in Odoo 19, both in odoo/addons/base/views/res_partner_views.xml. Unchanged in Odoo 20.
VersionsOdoo 19.0, Odoo 20.0
No-code setupNo. There is no Studio entry, and the widget depends on a server-computed json field.
Alternativesstatinfo, json, percentpie

What the contact_statistics widget does

The whole component is this:

export class ContactStatisticsField extends Component {
    static template = "web.ContactStatisticsField";
    static props = { ...standardFieldProps };

    get list() {
        return this.props.record.data[this.props.name] || [];
    }
}

It takes the json value, defaults it to an empty array when unset, and hands it to a template that renders the entries. There is no transformation, no formatting logic and no configuration.

Everything that makes the block useful, which statistics appear and what they say, is decided by the Python that computes the json field. The widget is a renderer and nothing more.

What this means for your team

On the contact form this is the block that tells you, at a glance, what this customer or vendor means to the business. Because the content is computed server-side, whoever owns that computation owns what your team sees.

That is the practical point: if the statistics on your contact form are not the ones your sales team actually cares about, the fix is in Python, not in the view. Changing the widget, the options or the layout will not add a number that the server is not sending.

Working examples

Placing the block on a form:

<field name="contact_statistics" widget="contact_statistics"/>

The field behind it must be a json field whose value is a list. A compute is the usual source:

contact_stats = fields.Json(compute="_compute_contact_stats")

def _compute_contact_stats(self):
    for partner in self:
        partner.contact_stats = [...]  # shape must match the template

Version compatibility

VersionStatusNotes
Odoo 19.0VerifiedVerified against the shipped 19.0 source.
Odoo 20.0VerifiedVerified against the 20.0 branch. No changes.

Unchanged between the two branches we checked, including its usage count.

What is changing in Odoo 20

No change. Diffing the registration between the 19.0 and 20.0 branches shows the same component, the same supportedTypes of json, and still no options. It appears in the same two places in res_partner_views.xml on both branches.

Common problems and fixes

SymptomCause and fix
The block renders emptyThe json field is unset or empty. The getter falls back to an empty array and the template renders nothing. Check the compute that fills the field. The widget cannot invent content.
A statistic you expected is missingThe server is not sending it. The widget renders exactly what the json contains. Change the Python compute, not the view.
Options on the field have no effectThe widget declares and reads no options. Remove them. Layout and content are controlled by the template and the server value.

Contact_statistics widget vs the alternatives

WidgetBest forKey difference
contact_statisticsThe contact form's computed statistics blockRead-only, no options, and tied to a server-computed json shape
statinfoA single headline number on a smart buttonClickable through to a filtered list, and far more widely used
jsonShowing the raw json payloadPrints formatted JSON text rather than a statistics list
percentpieOne value shown as a proportionGraphical, and takes a single number rather than a list

If you want a single number with a label and a click-through, the statinfo widget on a smart button is the far more common pattern and gives users somewhere to go. Reach for contact_statistics only when you are extending the contact form's existing block, since the template it renders into is fixed.

Frequently asked questions

What does the Odoo contact_statistics widget do?+
It renders a json field as a read-only list of statistics, used on the contact form. The component simply returns the field value, or an empty list when unset, and a fixed template draws it.
Can I configure which statistics appear?+
Not from the view. The widget declares no options and renders whatever the json field contains, so the content is decided by the server-side compute that fills that field.
Where is contact_statistics used in standard Odoo?+
Twice, both in res_partner_views.xml in the base module, on the contact form. The count is the same in Odoo 19 and Odoo 20.

Contact records that do not tell you enough?

The statistics on an Odoo contact form come from Python, not from the view, so the numbers your sales team keeps asking for are a compute away rather than a config change. We add the ones that actually drive your conversations.

Book a free consultation

How this page was produced

Verified by reading addons/web/static/src/views/fields/contact_statistics/contact_statistics.js on the 19.0 branch of a local clone of the official Odoo repository. The component is quoted in full above. The registration was diffed against the 20.0 branch. Usage counts come from scanning every XML file in Community, Enterprise and odoo/addons/base in both branches. Corrections welcome via our contact page.