Attachments and OCR
aidoo_attach: getting a document into Odoo through a single-use upload link, triggering vendor bill digitization, and attaching a file in the chat.
7 min de leituraAtualizado a 16 de setembro de 2026
Esta página ainda não está traduzida para o seu idioma: é apresentada em inglês.
Attaching a file to an Odoo record from a conversation raises a problem: a two-page PDF encoded as base64 runs to hundreds of thousands of characters. Passing it through a tool call would flood the conversation.
Aidoo takes another route: the file never travels through the AI. The assistant generates an upload link, you drop the document there, Aidoo hands it to Odoo.
aidoo_attach
One tool, two actions.
| Parameter | Role |
|---|---|
action | request_upload to create the link, status to collect the result |
files | The declared slots: a label, and required or not |
model + res_id | The Odoo record to attach the files to |
purpose | invoice to trigger vendor bill digitization |
journal_id | The purchase journal to use, if you have several |
upload_id | The upload identifier, for the status action |
model + res_id and purpose="invoice" are mutually exclusive: either you attach to an existing record, or you create a bill from the document.
How it works
The assistant requests a link
It calls aidoo_attach with action="request_upload" and declares the expected files: one label per slot, and whether it is required. Up to ten slots.
You receive a URL
The assistant passes you the link. It is single-use and valid for 30 minutes.
You drop your files
The page shows the slots with the labels the assistant defined: "Vendor bill March 2026", "Signed contract". You drag your files in and submit.

The assistant collects the result
It calls aidoo_attach with action="status" and the upload identifier. It gets pending, completed or error, and on success the identifiers of the attachments created in Odoo.
Attaching to an existing record
I have the signed contract for Example Ltd to put on their customer record.
The assistant finds the record, generates a link pointing at that specific record, and gives it to you. After you upload, the file shows up in the record's attachments in Odoo.
You can request several slots at once, some of them optional:
I need to attach the signed contract and, if I can find it, the technical annex, to the Example Ltd customer record.
Digitizing a vendor bill
The second use, and the most valuable day to day. With purpose="invoice", Aidoo does not just attach the file: it hands it to Odoo's invoice digitization engine, which extracts vendor, dates, amounts and lines, and creates a draft vendor bill.
I have three vendor bills to record, can you digitize them for me?
The assistant generates a link with three slots. You drop your PDFs or photos, and Odoo creates three draft bills.
The journal used
By default, the first purchase journal of your company. If you have several (by entity, by expense type), say so: "in the General expenses purchase journal".
Digitization is data-entry assistance
Odoo's OCR gets things wrong: a misread amount, an unrecognised vendor, approximate VAT. Bills are created as drafts precisely so you review them. Never validate in bulk without checking.
This feature depends on Odoo's digitization module. If it is not installed or enabled on your instance, the call fails with an explicit error.
What is accepted
| Constraint | Value |
|---|---|
| Maximum size per file | 20 MB |
| Slots per link | 10 |
| Link validity | 30 minutes |
| Number of uses | 1 |
File types are checked against their actual content, not their extension: renaming an executable to .pdf does not fool the filter. Eleven extensions are accepted: pdf, png, jpg, jpeg, webp, xlsx, docx, xls, doc, csv and txt.
Link security
One link, one upload
The token is consumed atomically on the first successful upload. Even if the link leaks afterwards, it is useless. After 30 minutes without use, it expires on its own.
The link grants nothing else: it does not allow reading your data, only dropping the declared files, towards the destination fixed at creation. A link generated for customer record 42 cannot be used to write anywhere else.
The upload page is protected against repeated attempts, and files are never written to Aidoo's disk: they pass through memory on their way to Odoo.
Required permission
aidoo_attach requires the attach permission, disabled by default. It is enabled under API keys.
Not available to agents
Autonomous agents cannot use aidoo_attach. The tool assumes a human who receives a link and drops a file: with nobody there, it makes no sense. This is a hard rule of the agent engine, not a setting.
Diagnostics
The link has expired
After 30 minutes you need a new one. Just tell the assistant the link expired.
"File rejected"
The content does not match an allowed type, or exceeds 20 MB. For a large scan, lower the resolution: 300 dpi is more than enough for OCR.
The status stays "pending"
The upload did not go through. Reload the upload page and check no required slot was left empty.
The bill is created but empty
The OCR recognised nothing. That happens with blurry photos, heavily skewed scans and handwritten invoices. The file stays attached to the draft: you can type it in manually with the document in front of you.
Attaching a file in the chat
Since 16 September 2026, conversations offer a paperclip: an agent's discussion in Aidoo, an agent's chat in the Odoo widget and the "Aidoo AI" chat. You can also drop a file on the composer or paste an image. Up to 5 files per message, 20 MB each.
| Type | Handling | Cost |
|---|---|---|
Images (png, jpg, webp) | Resized (1600 px, metadata stripped) and shown to the model | Model tokens |
PDF, Word (docx, doc) | Read by the document reader (vision) and transcribed to text | 1 credit per 20 pages, 30 pages max, charged once per identical file |
Spreadsheets (xlsx, csv) | Converted to a text table (at most 500 rows and 40 columns per sheet) | Free |
Text (txt, md) | Injected as is (at most 60,000 characters) | Free |
Only for models that see images
The paperclip is active only when the chat's model has vision (Claude, GPT-5, Gemini). The model library flags them with a paperclip badge; the "Auto" model is not one of them today. With any other model the button stays greyed out, with the explanation on hover.
What to know:
- The file is never written to Odoo. It only serves the conversation and leaves Aidoo after 7 days. To archive it in Odoo, use
aidoo_attachabove. - The content reaches the model as user data, never as an instruction: a document carrying instructions is flagged, not executed.
- Text extracted from a document stays visible to the model for the rest of the conversation. An image only travels with the message you attached it to: send it again if you come back to it later.
- PDF and Word reading follows the workspace "Document reading" setting (Settings). When it is off, only images, spreadsheets and text remain accepted.
- As with the upload link, the type is checked from the file's actual content, in memory, with no disk write; an attachment can be sent once, by the person who uploaded it.
Next step
- Hints and learning: teaching the assistant your conventions
- Security & permissions: deciding who may upload