List of Search Operators in Odoo

As your business grows, so does your data. Managing data efficiently is key to making informed business decisions. Odoo, the popular open-source enterprise resource planning (ERP) software, offers a wide range of features for business management.

One of the key features of Odoo is its powerful search functionality, which allows you to quickly find the information you need from your database.

In this article, we will explore the different search operators available in Odoo.

Table of Contents

Search Operators

The search domain can contain zero or multiple tuples. Each tuple needs to have 3 elements, in the form of ('field_name', 'operator', value).

['|', '|', ('default_code', 'ilike', self), ('name', 'ilike', self), ('barcode', 'ilike', self)]

In this part, we will only need to know all possible values of 'operator‘. This will help us explain correctly our search intent and make Odoo return the correct data set.

List of available term operators:

'=', '!=', '<=', '<', '>', '>=', '=?', '=like', '=ilike', 'like', 'not like', 'ilike', 'not ilike', 'in', 'not in','child_of', 'parent_of'

Logical Operators 

Tuples in the domain can be combined using logical operators. There are 3 of them.

  • &‘ (logical AND, default)
  • |‘ (logical OR)
  • !‘ (logical NOT)

The AND operator is used by default if there is no set operator.

Let’s go over some examples to see how their logic works.

[('default_code', 'ilike', keyword), ('name', 'ilike', keyword)]
=> ('default_code', 'ilike', keyword) AND ('name', 'ilike', keyword)
['|', ('default_code', 'ilike', keyword), ('name', 'ilike', keyword)]
=> ('default_code', 'ilike', keyword) OR ('name', 'ilike', keyword)

=> (name is 'ABC' AND (language is NOT english) AND (country is Belgium OR Germany))

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top