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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | default | |
| attachment_id | Yes | ir.attachment id | |
| move_id | No | account.move id (target for write-back). 0 = skip write-back. | |
| source | No | upload | |
| source_message_id | No | Gmail Message-ID for dedup. Only used when source='gmail'. | |
| model_override | No | Force a specific model, bypassing routing. Leave empty for auto. | |
| write_back | No | Write extracted data to account.move.extract_prefill_data. | |
| tenant_tier | No | business |