Create Record
odoo.create
ActionCRM & salesconnection required
Calls the Odoo API with the connection's credentials.
Create one record from 'values', or several in a single call from 'records'. The new ids are returned in creation order.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- Odoo
- Secret shape
- the API key, or {"api_key": "…"} — Odoo takes it in place of the password
- Config it needs
- base_url, db, username, uid
- Resolved by
- config.connection_id, else node.connection_id
Configuration
3 fields, 1 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
model Technical name of the Odoo model to act on, such as 'res.partner' or 'sale.order'. | string | Yes | — | — | res.partner |
values Field values to write, as a JSON object keyed by field name. | object | No | — | — | {"name":"Acme Ltd"} |
records Several records to create at once, as a JSON array of objects — an alternative to 'values'. | array | No | — | array of object | [{"name":"Acme Ltd"}] |
- At least one of values, records must be set.
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"model": "res.partner",
"records": [
{
"name": "Acme Ltd"
}
],
"values": {
"name": "Acme Ltd"
}
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
id Id of the first record created. | number | — |
ids Ids of every record created, in the order sent. | array | — |
created How many records were created. | number | — |
model The model the call was made against. | string | — |
{
"created": 0,
"id": 0,
"ids": [],
"model": ""
}Notes
- Odoo applies the model's own defaults and validations, so a create can fail on a required field this node never mentioned — run 'Odoo: Describe Fields' to see which fields the model requires.
- A many2one field comes back as a [id, display name] pair and is written as a bare id; one2many and many2many fields are written with Odoo's command triplets, e.g. [[6, 0, [1, 2]]] to replace the whole set.
See Create Record run in a workflow.
In a technical demo we add the Odoo connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.