Skip to main content
iVentureTeam

loyalty_data_field

The loyalty summary on a sale order: points, rewards, whatever the server computed. It is a display with no options at all, and it does not survive into the next version.

Siddharth JambukiyaSiddharth JambukiyaOdoo Techno-Functional Consultant
August 27, 2026Updated August 28, 20265 min read
Technical nameloyalty_data_field
Field typesjson
Viewsform
Modulesale_loyalty, loyalty and rewards on sales
Used in core1 occurrence, the loyalty summary on the sale order form
VersionsOdoo 19.0, Odoo 18.0
No-code setupNo. The summary is computed server side
Alternativeshtml, popover_widget, statinfo, account_batch_sending_summary

What the loyalty data panel does

Loyalty on a sale order is a computed picture: how many points this order earns, what the customer already has, which rewards are within reach. None of it is a field the user edits, and all of it depends on program rules that live on the server.

This widget is the panel that shows it. The server computes a structured summary into a field, and the widget unwraps that value and hands it to a template that lays out the figures.

There is nothing else to it. No options, no interaction, no supported types declared. It is the thinnest kind of Odoo widget: a component and a template over a server-computed value.

What this means for your team

Loyalty only changes behavior if the person taking the order can see it. A salesperson who knows the customer is forty points from a reward can say so; one who would have to open another screen will not. Putting the summary on the order is the whole mechanism by which a program influences a sale.

The planning point is the widget's fate. It is absent from the development branch, which means the loyalty summary on the sale order is being reworked. If your process or training depends on that panel, that is a change to check before upgrading rather than a rename to follow.

Working examples

The usual usage

<field name="loyalty_data"
       widget="loyalty_data_field"/>

No options. What appears is entirely the server's computation.

When nothing shows

# an empty summary renders nothing
{}

The widget treats an empty structure as absent, so the panel does not appear on orders with no loyalty context.

A generic alternative

<field name="loyalty_summary_html" widget="html"/>

Computing the panel as markup server side needs no JavaScript at all.

Unwrapping the value before each render

There is one method. Before each render the widget reads the field's value, checks whether it has any keys, and if so unwraps it out of the reactive proxy the framework wraps record data in, storing the plain object for the template.

Doing that before every render rather than once at startup means the panel follows a recomputed summary, which matters on an order where adding a line changes the points earned.

The emptiness check is the other detail. An object with no keys becomes a falsy value, so the template can hide the whole block rather than rendering an empty panel with headings and no figures.

Everything visible, the labels, the layout and which parts of the summary are shown, belongs to the template and to the server-side computation. The widget contributes the unwrapping and nothing more, which is why its removal in the next version says more about the surrounding feature than about the widget.

Version compatibility

VersionStatusNotes
Odoo 20.0In developmentNot released. The widget and its file are absent from the development branch.
Odoo 19.0VerifiedVerified against the shipped source. Identical to Odoo 18.
Odoo 18.0VerifiedFirst version.
Odoo 17.0Not availableWidget does not exist.
Odoo 16.0Not availableWidget does not exist.

Upgrade note. The widget arrived in Odoo 18 and is unchanged in Odoo 19, so nothing needs attention within that range. Going to the next version is different: the widget is gone, so any customization of the loyalty panel should be reviewed rather than migrated.

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 may still change; we re-verify this page after the release.

The widget is removed. There is no registration under this name on the development branch and the file is absent, which means the loyalty summary on the sale order is being reworked rather than renamed.

Because an unknown widget name falls back to the field's type, a custom view still naming it would render the raw structured value instead of the panel. Search custom sales views for this name before upgrading.

Common problems and fixes

SymptomCause and fix
The panel does not appearThe server computed an empty summary, which the widget treats as nothing to show. Check the loyalty program and the customer's card; an empty structure hides the block.
The figures do not updateThey should; the value is re-read before every render. Confirm the server recomputed the field rather than a related one.
Raw data appears instead of a panelThe widget name did not resolve, so the field fell back to its type. Check the widget is installed and, on the next version, that it still exists.
Options are ignoredThe registration has no extractor. Nothing to configure here.
Missing widget errorThe loyalty module is not installed in that database. Install sale loyalty.
It disappeared after upgradingThe widget is removed on the development branch. Review how the loyalty summary is presented in that version.

Loyalty data panel vs the alternatives

WidgetBest forKey difference
loyalty_data_fieldShowing a server-computed loyalty summary on an orderA display-only panel that unwraps its value before each render and hides itself when empty
htmlA panel computed as markup server sideNo JavaScript and no structure to match
popover_widgetA JSON-driven note behind an iconConfigurable icon, color and template from the payload
statinfoA single figure in a stat buttonOne number rather than a summary
account_batch_sending_summaryAnother read-only summary panelReads its value once rather than before each render

Where you control both sides, computing the panel as an HTML field server side is simpler and needs no JavaScript. Where a structured payload really is the right carrier, the inventory popover widget is the most configurable of the JSON-driven display widgets in core.

Frequently asked questions

What does the loyalty panel show?+
Whatever the server computed into the field: points earned, the customer's balance, rewards within reach. The widget only unwraps that value and hands it to a template.
Why does the panel sometimes not appear?+
An empty summary is treated as nothing at all, so the block is hidden rather than rendered with headings and no figures.
Does it update as the order changes?+
Yes. The value is read before every render, unlike some summary widgets that read once at startup.
Can I configure it?+
No. The registration provides a component only, with no options, no extractor and no supported types.
Does it exist in Odoo 20?+
Not on the development branch. The widget and its file are absent, so the loyalty summary is being reworked rather than renamed.

Loyalty programs that change what gets sold

Points, rewards and the moment a salesperson sees them are what make a program work rather than just exist. We implement Odoo loyalty and promotions across sales and point of sale, on versions 16 through 19.

Book a free consultation

How this page was produced

The unwrapping before each render, the emptiness check and the absence of options or supported types were read from loyalty_data_field.js on the Odoo 19.0 branch. Version coverage comes from the absence of the file on 16.0 and 17.0, a comparison with 18.0, and a search of the public development branch which found no registration. Spotted an error? Tell us and we will correct the page.