Using the Search View

Website development wordpress odoo manual cover post how to search view

Using the Search View: Odoo lets you find data quickly, with many different ways to search. If we understand how the system works…

Using the Search View

Odoo lets you find data quickly and offers many different ways to search.
Once you understand how the system works, you can get the most out of it.

The search input box only searches within the field you select. As you can see in the image, you can search by different columns.
Let's look at an example of what happens when the search does not match the field.

Website development wordpeess odoo th how to search bar work basic preview
Website development wordpeess odoo th how to search bar work basic preview

 

In this example, we search for the word “Bangkok” in the Name field.
Result: 8 records. Every record containing the word “Bangkok” is displayed.

Website development wordpeess odoo th how to search bar work basic preview search name
Website development wordpeess odoo th how to search bar work basic preview search name

 

In this example, we search for the word “Bangkok” in the “Sub-district” field.
Result: no data found, because the “Sub-district” field does not contain the word “Bangkok” at all.

Website development wordpress odoo th how to search bar work basic preview search wrong field
Website development wordpress odoo th how to search bar work basic preview search wrong field

 

Searching the same field again increases the results

The first search for “Bangkok” returns 8 results, but when we add a search for “Yai”, the number of results goes up. Why?
Because searching the same field more than once works as an “or”.

Website development wordpress odoo th how to search bar work basic preview search same field or logic
Website development wordpress odoo th how to search bar work basic preview search same field or logic

 

“Or” here means: search the Name field for records containing “Bangkok” or “Yai”.
So every record whose Name contains “Bangkok” or “Yai” is displayed.

Website development wordpress odoo th how to search bar work basic preview search same field
Website development wordpress odoo th how to search bar work basic preview search same field

How to search the same field multiple times

What if you want to filter for records that contain both “Bangkok” and “Yai”?
Step 1: Search for “Bangkok” once.
Then go to Add Custom Filter.

Website development wordpress odoo th how to search bar work basic preview advance filter menu
Website development wordpress odoo th how to search bar work basic preview advance filter menu

 

When you click Add Custom Filter, a window for building a Domain appears (to learn more, see the related article above).
Set the first box to “Name”, contains, Yai (type the additional word you want to search for).
Then click Add.

Website development wordpress odoo th how to search bar work basic preview advance filter menu domain
Website development wordpress odoo th how to search bar work basic preview advance filter menu domain

Result: 2 records.
Notice that the Search bar now shows separate boxes, unlike the “or” example above.
When the two filters are separated like this, it means “and”.

Website development wordpress odoo th how to search bar work basic preview search same field and logic
Website development wordpress odoo th how to search bar work basic preview search same field and logic

In this example:
Search 1 looks for “Bangkok” and “Yai”.
The result: the first search on the Name field shows all records containing “Bangkok”, which is 8 records.
The second search on the Name field shows records containing “Yai” from within the first search results (out of those 8 records).

Website development wordpress odoo th how to search bar work basic preview advance filter menu domain add
Website development wordpress odoo th how to search bar work basic preview advance filter menu domain add

Search Bar summary

When using the Search bar, you must choose the correct field or column.
Searching the same field in the Search bar is equivalent to “or”, which broadens the search results.

Website development wordpress odoo th how to search bar work basic preview search same field or logic

To search the same field again, use Add Custom Filter to apply “and” to the search terms, which narrows the search results.

Website development wordpress odoo th how to search bar work basic preview search same field and logic