generate_pdf
Generate a PDF from an Odoo record and return the file path. Reuses existing PDFs or uses the record's print wizard.
Instructions
Render the PDF of a record and return where it was saved.
An already rendered PDF is reused. Otherwise the model's own print/send
wizard produces it, and that wizard can also SEND the document — which is
why this is gated on action_send_and_print (L3_STATE_CHANGE) rather
than as a plain read.
Args: model: the Odoo model, e.g. "account.move". record_id: id of the record to print. dest_dir: directory to write the PDF into. Defaults to this platform's temporary directory — "/tmp" does not exist on Windows.
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>",
"record_id": "<record_id>"
},
"name": "generate_pdf"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| dest_dir | No | ||
| record_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |