ai_invoice_extract
Extracts structured invoice data from Odoo attachments using AI vision. Routes to optimal model based on size, writes data back to account.move, and logs token usage and cost.
Instructions
Extract structured invoice data from an Odoo attachment via Anthropic Vision. Auto-routes to haiku/sonnet/opus based on pages+size. Writes extract_prefill_data back to account.move (if write_back). Logs usage to the billing ledger with token counts + cost in millicents.
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": {
"attachment_id": "<attachment_id>"
},
"name": "ai_invoice_extract"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | upload | |
| move_id | No | account.move id (target for write-back). 0 = skip write-back. | |
| connection | No | default | |
| write_back | No | Write extracted data to account.move.extract_prefill_data. | |
| tenant_tier | No | business | |
| attachment_id | Yes | ir.attachment id | |
| model_override | No | Force a specific model, bypassing routing. Leave empty for auto. | |
| source_message_id | No | Gmail Message-ID for dedup. Only used when source='gmail'. |