stock.rule: fields, relations and API
The stock.rule model ("Stock Rule") is a persistent model declared by the Inventory module, then extended by 16 other modules. It exposes 28 fields, 22 of them declared directly on the model; 12 fields from other models point 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
stock.rule- Label
- Stock Rule
- Type
- Persistent (models.Model)
- SQL table
stock_rule- Origin module
- Inventory (
stock) - Extended by
- sale_stock, point_of_sale, mrp, purchase_stock, product_expiry, mrp_subcontracting, sale_purchase_stock, stock_dropshipping, mrp_subcontracting_dropshipping, purchase_mrp, mrp_subcontracting_purchase, project_mrp, project_mrp_account, sale_mrp, project_purchase_stock, purchase_requisition_stock
- Default order (_order)
sequence, id
Model fields
22 own fields, 0 inherited from mixins and 6 automatic ORM fields. Click a name to get a direct link to that field.
28 of 28 fields shown
| Technical name | Label | Type | Details |
|---|---|---|---|
| action | Action | selection | required Values: |
| active | Active If unchecked, it will allow you to hide the rule without removing it. | boolean | |
| auto | Automatic Move The 'Manual Operation' value will create a stock move after the current one. With 'Automatic No Step Added', the location is replaced in the original move. | selection | required Values: |
| company_id | Company | many2one | |
| delay | Lead Time The expected date of the created transfer will be computed based on this lead time. | integer | |
| location_dest_from_rule | Destination location origin from rule When set to True the destination location of the stock.move will be the rule.Otherwise, it takes it from the picking type. | boolean | |
| location_dest_id | Destination Location | many2one | required |
| location_src_id | Source Location | many2one | |
| name | Name This field will fill the packing origin and the name of its moves | char | requiredtranslatable |
| partner_address_id | Partner Address Address where goods should be delivered. Optional. | many2one | |
| picking_type_code_domain | Picking Type Code Domain | json | computed |
| picking_type_id | Operation Type | many2one | required |
| procure_method | Supply Method Take From Stock: the products will be taken from the available stock of the source location. Trigger Another Rule: the system will try to find a stock rule to bring the products in the source location. The available stock will be ignored. Take From Stock, if Unavailable, Trigger Another Rule: the products will be taken from the available stock of the source location.If there is no stock available, the system will try to find a rule to bring the products in the source location. | selection | required Values: |
| propagate_cancel | Cancel Next Move When ticked, if the move created by this rule is cancelled, the next move will be cancelled too. | boolean | |
| propagate_carrier | Propagation of carrier When ticked, carrier of shipment will be propagated. | boolean | |
| push_domain | Push Applicability | char | |
| route_company_id | Route Company | many2one | related: |
| route_id | Route | many2one | required |
| route_sequence | Route Sequence | integer | related: |
| rule_message | Rule Message | html | computed |
| sequence | Sequence | integer | |
| warehouse_id | Warehouse | many2one | |
| 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
- res.company: company_id, route_company_id
- res.partner: partner_address_id
- stock.location: location_dest_id, location_src_id
- stock.picking.type: picking_type_id
- stock.route: route_id
- stock.warehouse: warehouse_id
Fields of other models pointing here
- stock.move: rule_id
- stock.warehouse: buy_pull_id, manufacture_mto_pull_id, manufacture_pull_id, mto_pull_id, pbm_mto_pull_id, repair_mto_pull_id, sam_rule_id, subcontracting_dropshipping_pull_id, subcontracting_mto_pull_id, subcontracting_pull_id
- stock.warehouse.orderpoint: 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/stock.rule/search_read" \
-H "Authorization: bearer $ODOO_API_KEY" \
-H "X-Odoo-Database: your-db" \
-H "Content-Type: application/json" \
-d '{"domain":[],"fields":["name","action","auto","location_dest_id","picking_type_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}/stock.rule/search_read",
headers=headers,
json={"domain": [], "fields": ["name","action","auto","location_dest_id","picking_type_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/stock-rule">stock.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.