Odoo 19.0 Community · Persistent

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 nameLabelTypeDetails
actionActionselection
required

Values: pull (Pull From), push (Push To), pull_push (Pull & Push)

activeActive

If unchecked, it will allow you to hide the rule without removing it.

boolean
autoAutomatic 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: manual (Manual Operation), transparent (Automatic No Step Added)

company_idCompanymany2one
delayLead Time

The expected date of the created transfer will be computed based on this lead time.

integer
location_dest_from_ruleDestination 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_idDestination Locationmany2one
required
location_src_idSource Locationmany2one
nameName

This field will fill the packing origin and the name of its moves

char
requiredtranslatable
partner_address_idPartner Address

Address where goods should be delivered. Optional.

many2one
picking_type_code_domainPicking Type Code Domainjson
computed
picking_type_idOperation Typemany2one
required
procure_methodSupply 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: make_to_stock (Take From Stock), make_to_order (Trigger Another Rule), mts_else_mto (Take From Stock, if unavailable, Trigger Another Rule)

propagate_cancelCancel Next Move

When ticked, if the move created by this rule is cancelled, the next move will be cancelled too.

boolean
propagate_carrierPropagation of carrier

When ticked, carrier of shipment will be propagated.

boolean
push_domainPush Applicabilitychar
route_company_idRoute Companymany2one

related: route_id.company_id

route_idRoutemany2one
required
route_sequenceRoute Sequenceinteger

related: route_id.sequence

rule_messageRule Messagehtml
computed
sequenceSequenceinteger
warehouse_idWarehousemany2one
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

  • 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
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}'
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}/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.