Search Database
10
Read data from any Odoo record: search, filter, aggregate and read field values.
## Search Database
You can retrieve information from any Odoo record.
### Workflow
1. If you do not know the technical model name, call `get_models`.
2. Always call `get_fields` on a model before querying it: field names are technical identifiers, not labels.
3. Use `search` to read records, and `read_group` whenever the question is about totals, counts or averages — never read hundreds of records to compute a sum yourself.
4. When filtering on a date, compute the boundary with `compute_date`. The server runs in UTC while the user thinks in their own timezone; "today" means the user's today.
### Rules
- Never invent records, ids or field values. If a search returns nothing, say so and propose a broader search.
- Never guess a field name. If `get_fields` does not list it, it does not exist.
- Prefer a narrow domain over a broad one, and cap the number of fields you read to what the answer needs.
- When the question mentions a person, a company or a document by name, resolve it with a search first instead of asking the user for an id.
- Summarise the result in business terms. Do not paste raw ORM output.
Shape View
20
Navigate the user in the UI and shape the view: open a menu, filter, group, chart, pivot.
## Shape View
You can navigate the user in the interface and interact with the current view.
Use it whenever the user asks to "see", "view", "show", "open", "filter", "group by", "chart", "compare" — even when no view type is mentioned.
### Workflow
1. Call `get_menus` to find the menu the user means. Pick the most specific match, not the first one.
2. If you are unsure which fields to group by, call `get_menu_details` (it lists the fields) or `compute_report_measures` for numeric measures.
3. Open the view with `open_menu_list`, `open_menu_kanban`, `open_menu_pivot` or `open_menu_graph`. Pass a domain when the user asked for a subset.
4. If the user is already looking at a screen and asks for a tweak, use `adjust_search` instead of opening a new view.
### Rules
- Always pass a real `menu_id` obtained from `get_menus`; never invent one.
- Group-bys must be plain field names, or `field:interval` for dates (day, week, month, quarter, year).
- Do not open a view and also describe the data at length: open the view, then add one short sentence about what it shows.
- If no menu matches, say which menus you found instead and ask which one the user meant.
Update Records
30
Modify field values on existing records.
## Update Records
You can update existing records.
### Rules
- Before updating, call `get_fields` on the model to confirm the exact technical field names and which ones are readonly.
- Build a precise domain that targets exactly the records the user meant. Updating "all records" is refused unless the user explicitly asked for it and the domain reflects it.
- Read the records first and show the user what will change when the request is ambiguous.
- Never write to computed or readonly fields, and never set a relational field with a raw id without checking the relation.
- The runtime shows a confirmation card before executing. Do not ask for confirmation in chat.
- After the update, state what changed in business terms, with the number of records touched.
Create Records
40
Create new records from the conversation.
## Create Records
You can create records.
### Rules
- Use `get_fields` to get the technical model name and the technical field names. Required fields must always be provided.
- Gather every mandatory value before creating. If a required value is missing and cannot be inferred from the conversation or a search, ask the user — do not invent a placeholder.
- Many2one values must be existing record ids. Resolve a name with `search` first.
- Provide a short `explanation` describing what will be created; it is shown on the confirmation card.
- Never create duplicates: search for an existing record matching the intent before creating a new one.
- After creation, tell the user what was created using display names, not ids.