How to Set Domain for Relational Field in Odoo

Subscribers:
28,000
Published on ● Video Link: https://www.youtube.com/watch?v=YV4a3spfGyo



Category:
Tutorial
Duration: 5:57
4,552 views
28


Odoo domain is used to select records from a model or database table. It is a very common use case when you need to display a subset of all available records from an action, or to allow only a subset of possible records to be the target of a many2one relation. The way to describe these filters in Odoo is called a domain. It can be defined as a list of operations that are used to filter your data or for searching.
Each condition in a domain contains a field name, operator, and value.

The syntax is as follows:
domain="[(field_name, 'operator', ‘value’)]"
field_name: In this, the field name indicates simply the field name in which you want to assign the domain.
Operator: The list of operators used are given below
* =like’ operator: This operator matches against a pattern. The ‘%’ symbol matches any sequence of characters. It returns the exact case-sensitive search.
Eg: [('name', '=like', 'odoo')] - this returns ‘odoo’
*l ike’ operator: This operator matches against a ‘%value%’ pattern, which is similar to ‘ilike’ operator. It also returns a case-sensitive search.
Eg: [('name', '=like', 'odoo')] - this returns ‘%odoo%’.
* ilike’ operator: This operator returns exact case insensitive search.
Eg: [('name', '=like', 'odoo')] - this returns ‘%Odoo%’, ‘%odoo’
* not like’ and ‘not ilike’ operators: ‘not like’ operator returns result not matched with case sensitive and ‘not ilike’ operator returns result not matched with case insensitive.
* In’ and ‘not in’ operators: These operators are used to check whether the value is present or not present in a list of values.
* child_of’ operator: This operator is used to find children's values in a hierarchical relation.

#odoo #odoo14 #odoodevelopment #odootutorials #cybrosys #cybrosystutorials







Tags:
odoo related field
odoo related fields many2one
odoo relation
odoo fields
odoo domain
odoo domain configuration
odoo for beginners
how to extend selection field in odoo
how to create related field in odoo
how to create filter in many2one field in odoo
how to hide fields based on condition in odoo
odoo field domain
how to add filter in many2one field
give domain based on another field
odoo relational fields
odoo
odoo14
odoo tutorials
odoo technical