loyalty_one2many
The Rules and Rewards blocks on an Odoo loyalty program form look custom, but loyalty_one2many is just the standard x2many widget wearing a different template: a heading with the field label and an always present Add button.
August 24, 2026Updated August 24, 20264 min read
| Technical name | loyalty_one2many |
|---|---|
| Field types | one2many, many2many |
| Views | form (loyalty program form, kanban mode sub views) |
| Module | loyalty |
| Used in core | 3 occurrences in 1 module: the rule and reward lists on the loyalty program form in loyalty |
| Versions | Odoo 20.0, Odoo 19.0, Odoo 18.0, Odoo 17.0, Odoo 16.0 |
| No-code setup | No. Applied via the widget attribute in view XML |
| Alternatives | one2many, many2many, section_and_note_text |
What the Loyalty list widget does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
create | boolean or domain | Inherited from x2many. Allows or forbids creating sub records; a domain is evaluated against the parent record. Gates what the Add button can do. |
delete | boolean or domain | Inherited from x2many. Controls removing sub records, boolean or parent evaluated domain. |
link | boolean or domain | Inherited from x2many. Controls linking existing records where the relation allows it. |
unlink | boolean or domain | Inherited from x2many. Controls detaching records without deleting them. |
write | boolean or domain | Inherited from x2many. New gating in 19: controls whether sub records open editable.(since Odoo 19.0) |
The Add button bypasses nothing: create permission and the create option are still enforced by the inherited onAdd flow. Hiding creation via options also hides this button's effect, not the button itself.
Working examples
A thirteen line widget that has not changed since Odoo 16
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. The development branch file is byte-identical to 19.0; see below. |
| Odoo 19.0 | Verified | Verified against the shipped source. Identical behavior to 18.0. |
| Odoo 18.0 | Verified | Cosmetic class body reformat only. |
| Odoo 17.0 | Verified | Switched to the descriptor spread registration pattern; same behavior. |
| Odoo 16.0 | Verified | Original version, registered the component class directly. |
Stable since 16.0. Upgrades are a non event for this widget; test the surrounding loyalty views instead.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The Add button says Add instead of the add-label text | The control panel button caption is hardcoded in the loyalty template; add-label only feeds the inline kanban add link. Override the loyalty.LoyaltyX2ManyField template in a custom module if the caption must change. |
| The heading shows the wrong title | The h4 renders the field's label string, which a view or Studio relabel changes. Set the desired string attribute on the field element in the view. |
| Add button visible but clicking does nothing for some users | Create access on loyalty.rule or loyalty.reward is denied, or a create option domain evaluates false for this parent. Check access rights and the options dict on the field; the button honors both. |
Loyalty list widget vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
loyalty_one2many | Rule and reward lists on loyalty program forms | Stock x2many plus a heading and an always visible Add button |
| one2many | Any standard sub record list | Default control panel, label rendered by the form layout instead of the widget |
| many2many | Linking existing records rather than owning them | Link and unlink semantics, Add picks existing records |
| section_and_note_text | Structured document lines with sections and notes | Line styling machinery for account style tables, not kanban cards |
Frequently asked questions
Is loyalty_one2many different from the normal one2many widget?+
Which fields use loyalty_one2many in core Odoo?+
Can I reuse loyalty_one2many on my own model?+
Why does my Add a rule label not appear on the button?+
Loyalty programs that need more than the defaults?
Tiered rewards, partner specific promotions and PoS synced gift cards all start as rule and reward lines behind this widget. We design and build loyalty mechanics across Odoo Sales, Website and Point of Sale, including the custom widgets when the defaults stop fitting.
Plan your loyalty setup with us