Attachments and OCR
aidoo_attach: getting a document into Odoo through a single-use upload link, and triggering vendor bill digitization.
5 min de leituraAtualizado a 7 de agosto 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.
Next step
- Hints and learning: teaching the assistant your conventions
- Security & permissions: deciding who may upload