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 name | Label | Type | Details |
|---|---|---|---|
| active | Active | boolean | |
| any_product | Any Product Technical field, whether all product match | boolean | computed added by Point of Sale - Coupons & Loyalty ( |
| code | Discount code | char | computed, stored |
| company_id | Company | many2one | related: |
| currency_id | Currency | many2one | related: |
| minimum_amount | Minimum Purchase | monetary | |
| minimum_amount_tax_mode | Minimum Amount Tax Mode | selection | required Values: |
| minimum_qty | Minimum Quantity | integer | |
| mode | Application | selection | computed, stored Values: |
| product_category_id | Categories | many2one | |
| product_domain | Product Domain | char | |
| product_ids | Products | many2many | |
| product_tag_id | Product Tag | many2one | |
| program_id | Program | many2one | required |
| program_type | Program Type | selection | related: |
| promo_barcode | Barcode 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 ( |
| reward_point_amount | Reward | float | |
| reward_point_mode | Reward Point Mode | selection | required Values computed at runtime |
| reward_point_name | Reward Point Name | char | read-only related: |
| reward_point_split | Split 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_debug | User Has Debug | boolean | computed |
| valid_product_ids | Valid Product These are the products that are valid for this rule. | many2many | computed added by Point of Sale - Coupons & Loyalty ( |
| website_id | Website | many2one→ website | related: added by Coupons, Promotions, Gift Card and Loyalty for eCommerce ( |
| create_date | Created on | datetime | read-onlyautomatic |
| create_uid | Created by | many2one | read-onlyautomatic |
| display_name | Display Name | char | read-onlycomputedautomatic |
| id | ID | integer | read-onlyautomatic |
| write_date | Last Updated on | datetime | read-onlyautomatic |
| write_uid | Last Updated by | many2one | read-onlyautomatic |
Relations
Models linked from this model
- loyalty.program: program_id
- product.category: product_category_id
- product.product: product_ids, valid_product_ids
- product.tag: product_tag_id
- res.company: company_id
- res.currency: currency_id
- website: website_id
Fields of other models pointing here
- sale.order: code_enabled_rule_ids
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 -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}'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.