aggregate_records
Group and aggregate Odoo records server-side with a single call. Supports sums, averages, counts, and more over specified fields and groups.
Instructions
Group and aggregate records server-side (one call instead of pulling rows).
Args: model: Technical model name, e.g. 'sale.order'. group_by: One or more fields to group on. A field may carry a granularity, e.g. 'date_order:month'. measures: 'field:agg' specs. Bare 'field' means sum. Allowed aggregators: sum, avg, min, max, count, count_distinct. Omit to count records. domain: Odoo search domain (list of triplets). Defaults to all records. limit: Max groups (capped by ODOO_MAX_RECORDS). offset: Pagination offset over groups. order: Sort spec, e.g. 'amount_total desc'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| model | Yes | ||
| order | No | ||
| domain | No | ||
| offset | No | ||
| group_by | Yes | ||
| measures | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |