odoo_attachment_upload
Upload a file to an Odoo record and return its attachment ID for linking to messages or other records.
Instructions
Upload a file as an ir.attachment on an Odoo record. Returns the attachment ID which can be used with odoo_message_post (attachment_ids parameter) or linked to any record.
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>",
"res_id": "<res_id>",
"filename": "<filename>",
"content_base64": "<content_base64>"
},
"name": "odoo_attachment_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | Model name (e.g. 'sale.order') | |
| res_id | Yes | Record ID to attach to | |
| filename | Yes | File name (e.g. 'report.pdf') | |
| mimetype | No | MIME type (optional, auto-detected) | |
| connection | No | default | |
| content_base64 | Yes | Base64-encoded file content |