count_records
Count records in an Odoo model that match a domain, with company and move type filters for reliable numbers.
Instructions
Count the records matching a domain (Odoo search_count).
A count is only as honest as its domain:
account.move/account.move.linewithout amove_typefilter is refused — it would count invoices, bills, credit notes and journal entries together and match no figure the user has ever seen.A count answers "how many", never "how much". For an amount, read
amount_total_signed(company currency) and neveramount_total.On a multi-company instance the count differs per company: pass
company_idsor you are reporting one company as the whole business.
Args: model: Odoo model, e.g. "crm.lead". domain: Odoo domain. Omit to count everything the model holds. company_ids: Companies to count in, e.g. [1, 2].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | Yes | ||
| domain | No | ||
| company_ids | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |