Domain expressions
The domain is used to filter data records. They use a specific syntax that the Odoo ORM parses to produce the SQL WHERE expressions that will query the database.
A domain expression is a list of conditions. Each condition is a ('<field_name>', '<operator>', <value>') tuple. For example, this is a valid domain expression, with only one condition: [('is_done','=',False)].
The following is an explanation of each of these elements:
The <field_name> is the field being filtered, and can use dot-notation for fields in related models.
The <value> is evaluated as a Python expression. It can use literal values, such as numbers, Booleans, strings, or lists, and can use fields and identifiers available in the evaluation context. There ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access