odoo_write
odoo_writeUpdate fields on an Odoo record as a draft change and return a link for the user to review and approve in Odoo.
Instructions
Change fields of a record, as the user could on its form. Every change is a draft: it is saved when the user opens the returned link in Odoo and approves it. Give them the link.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>",
"id": "<id>",
"values": "<values>"
},
"name": "odoo_write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The record's id. | |
| draft | No | true: returns a link where the user reviews and approves the change in Odoo. false: saves now. | |
| model | Yes | Technical model name, e.g. "sale.order". | |
| reason | No | With draft=false: why it is right to save without the user approving it (what they asked and why the values are correct). Kept in the call log. | |
| values | Yes | Field name -> value, as on the form (odoo_browse describe=true lists them). many2one: an id; many2many: the full list of ids; dates "YYYY-MM-DD", datetimes "YYYY-MM-DD HH:MM:SS" in UTC. Lines (one2many) are records of their own: create each with odoo_create, pointing to its parent. A long text, HTML or file value: give {"upload": true} for that one field and send it to the returned upload_url. active=false archives the record and active=true restores it. |