Odoo 19.0 Community · Persistent

loyalty.rule: fields, relations and API

The loyalty.rule model ("Loyalty Rule") is a persistent model declared by the Coupons & Loyalty module, then extended by 2 other modules. It exposes 29 fields, 23 of them declared directly on the model; 1 field from other models points to it. Below you will find every field with its technical name, type, label and relations, followed by an Odoo 19 JSON-2 API call.

Model identity

Technical name
loyalty.rule
Label
Loyalty Rule
Type
Persistent (models.Model)
SQL table
loyalty_rule
Origin module
Coupons & Loyalty (loyalty)
Extended by
pos_loyalty, website_sale_loyalty
Inherits from (mixins)
pos.load.mixin

Model fields

23 own fields, 0 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.

29 of 29 fields shown

Technical nameLabelTypeDetails
activeActiveboolean
any_productAny Product

Technical field, whether all product match

boolean
computed

added by Point of Sale - Coupons & Loyalty (pos_loyalty)

codeDiscount codechar
computed, stored
company_idCompanymany2one

related: program_id.company_id

currency_idCurrencymany2one

related: program_id.currency_id

minimum_amountMinimum Purchasemonetary
minimum_amount_tax_modeMinimum Amount Tax Modeselection
required

Values: incl (tax included), excl (tax excluded)

minimum_qtyMinimum Quantityinteger
modeApplicationselection
computed, stored

Values: auto (Automatic), with_code (With a promotion code)

product_category_idCategoriesmany2one
product_domainProduct Domainchar
product_idsProductsmany2many
product_tag_idProduct Tagmany2one
program_idProgrammany2one
required
program_typeProgram Typeselection

related: program_id.program_type

promo_barcodeBarcode

A technical field used as an alternative to the promo code. This is automatically generated when the promo code is changed.

char
computed, stored

added by Point of Sale - Coupons & Loyalty (pos_loyalty)

reward_point_amountRewardfloat
reward_point_modeReward Point Modeselection
required

Values computed at runtime

reward_point_nameReward Point Namechar
read-only

related: program_id.portal_point_name

reward_point_splitSplit per unit

Whether to separate reward coupons per matched unit, only applies to 'future' programs and trigger mode per money spent or unit paid...

boolean
user_has_debugUser Has Debugboolean
computed
valid_product_idsValid Product

These are the products that are valid for this rule.

many2many
computed

added by Point of Sale - Coupons & Loyalty (pos_loyalty)

website_idWebsitemany2one

related: program_id.website_id

added by Coupons, Promotions, Gift Card and Loyalty for eCommerce (website_sale_loyalty)

create_dateCreated ondatetime
read-onlyautomatic
create_uidCreated bymany2one
read-onlyautomatic
display_nameDisplay Namechar
read-onlycomputedautomatic
idIDinteger
read-onlyautomatic
write_dateLast Updated ondatetime
read-onlyautomatic
write_uidLast Updated bymany2one
read-onlyautomatic

Relations

Models linked from this model

Fields of other models pointing here

Reading this model through the API

Odoo 19 JSON-2 API call reading the first five records with real fields of the model. Replace the instance, database and API key with your own.

curl
curl -X POST "https://your-instance.odoo.com/json/2/loyalty.rule/search_read" \
  -H "Authorization: bearer $ODOO_API_KEY" \
  -H "X-Odoo-Database: your-db" \
  -H "Content-Type: application/json" \
  -d '{"domain":[],"fields":["minimum_amount_tax_mode","program_id","reward_point_mode","company_id","currency_id"],"limit":5}'
Python (requests)
import requests

BASE_URL = "https://your-instance.odoo.com/json/2"
headers = {"Authorization": f"bearer {API_KEY}", "X-Odoo-Database": "your-db"}

res = requests.post(
    f"{BASE_URL}/loyalty.rule/search_read",
    headers=headers,
    json={"domain": [], "fields": ["minimum_amount_tax_mode","program_id","reward_point_mode","company_id","currency_id"], "limit": 5},
)
res.raise_for_status()
print(res.json())
  • External API access requires Odoo's Custom plan.
  • XML-RPC and JSON-RPC will be removed in Odoo 22 (fall 2028): use JSON-2.
  • The access rights and record rules of the key's user apply.

Cite this tool

Writing a tutorial, internal documentation or a forum answer? Copy this link to send your readers to the up-to-date reference.

<a href="https://aidoo.ai/en/outils/explorateur-modeles-odoo/loyalty-rule">loyalty.rule (Odoo 19.0)</a>

Sources

Data verified on September 23, 2026 · Odoo 19.0 Community

Have an Odoo project, or want to put your ERP to work with AI? Let's talk

Implementation, custom module development, connecting Claude or ChatGPT to your data: tell us about your context and we will reply within 24 business hours.