Reading your data
aidoo_query, aidoo_read and aidoo_schema: filters, pagination, sorting, schema discovery, and how to phrase a request to get an exact result.
5 min readUpdated October 1, 2026
Three tools cover all reading of records. They are granted by default on a new key and cannot change anything: their binding to Odoo is locked server-side. The content of attached files (PDFs, scans) belongs to a fourth tool, covered further down.
aidoo_query
The search tool. It combines a filter and a read in a single Odoo call (search_read).
| Parameter | Role | Default |
|---|---|---|
model | The target Odoo model, sale.order for instance | required |
domain | The filter, in Odoo domain format | required |
fields | The fields to return | default set |
limit | Maximum number of records | 80 |
offset | Number of records to skip | 0 |
order | The sort, date_order desc for instance | model default |
The domain, in plain terms
An Odoo domain is a list of conditions. The assistant builds them for you, but being able to read them helps you check it understood.
[["state", "=", "sale"], ["amount_total", ">", 10000]]Reads as: state equals "confirmed order" and amount above 10,000. Conditions combine with AND by default.
Common operators: =, !=, >, >=, <, <=, ilike (contains, case-insensitive), in, not in, child_of, parent_of. To combine differently: "&" (AND), "|" (OR), "!" (NOT), placed before the conditions they apply to.
Ask to see the filter
When a result looks off, ask "which filter did you use?". The assistant shows you the exact domain. It is the fastest way to catch a misreading: a forgotten status, a date off by one day.
Pagination: how the assistant knows there is more
Every response carries total_count, has_more and, when records remain, next_offset, the point where the next page resumes. The assistant therefore sees immediately that its page of 80 rows belongs to a set of 1,240, and tells you rather than concluding from a sample.
If you want everything: say so explicitly ("go through all the pages"). If you want a total, do not ask for the list, ask for the total, and the assistant will use aidoo_report, which is far more efficient.
Sorting
My 10 largest orders this year, highest first.
The assistant translates that into order: "amount_total desc" and limit: 10. Without an explicit sort, Odoo applies the model's default order, which is rarely the one you expect.
aidoo_read
Reads records whose identifiers are already known. Parameters: model, ids, fields.
You will never ask for it directly: the assistant uses it as a second step, after finding the records with aidoo_query. Its presence in the log simply signals a targeted read.
aidoo_schema
Discovers the shape of your database, without reading any business data.
- With no argument: the list of accessible models, the ones you marked as priority first
- With
model: that model's fields, their types, their relations, and the associated hint
What custom fields do we have on the customer record?
This is what lets the assistant work on your Odoo rather than a stock one: your x_* fields, the models added by a vertical module, your custom selections. To compare with stock Odoo, our Odoo 20 model explorer lists the fields of every Community model.
The schema is introspected, not guessed
Aidoo reads the real structure after every successful Odoo connection, then refreshes it every night. A field added in Odoo therefore becomes visible by the next day at the latest, or right away if you run an introspection from Odoo Connection → Models (Introspect button).
Reading the content of an attachment
The three tools above read the fields of records, not the content of attached files. For a PDF, a scan or a Word document attached to a record, the assistant uses aidoo_document: transcription, signatures, dates, amounts.
Did quotation S00042 come back signed? Look at its attachment.
This tool is not granted by default: it requires the document permission and costs 1 credit per block of 20 pages, only once per document. The details are in the MCP tool reference.
Phrasing a read request well
Name the scope. "The orders" is ambiguous; "the confirmed sales orders" is not.
Bound the period. "This month" is fine in a conversation where the context is clear, but "between 1 and 30 June 2026" leaves no room for doubt.
Say what you want to see. Asking for the useful fields ("with the customer, the date and the amount") avoids an over-broad answer and speeds up the call.
Distinguish list from total. "List me" triggers aidoo_query; "how many" or "what total" triggers aidoo_report. On a large database, the two do not cost the same.
The most common mistakes
An empty result although the data exists
Three causes, in order:
- An overlooked status: quotations are not orders, draft invoices are not validated invoices
- The Odoo account's rights: the user whose API key backs the connection may not see those records
- A multi-company rule: the record belongs to a company that account cannot see
"Access denied: model … is blocked"
The model is blocked in your Aidoo settings, or it is not among the exposed models (not introspected yet, for example). This is not an Odoo error but a rule on the Aidoo side, see Security & permissions.
Numbers that do not match Odoo
Compare the scopes first: Aidoo returns exactly what the domain asks for. A discrepancy almost always comes from a filter that differs from your Odoo view, currency, company, status, or cancelled lines included.
Ask for the domain used, and compare it with the filters on your Odoo screen.
Next step
- Reports and PDFs: aggregating and producing documents
- Writing to Odoo: moving from consulting to acting