Odoo Help


optional parameter fields/domain

on 6/5/13, 5:36 AM 3,613 views

Hello all, how the domain fields is working, explain with sample code

Hiral Patel (hip)
On 6/5/13, 6:14 AM

Domain is working like select query of sql having where condition. We can give 'and' & 'or' conditions in that.

Example: <record model="ir.actions.act_window" id="crm_case_category_act_leads_all"> <field name="name">Leads</field> <field name="res_model">crm.lead</field> <field name="domain">['|', ('type','=','lead'), ('type','=',False)]</field> </record>

This will give the same output as following sql query: select * from crm_lead where type = 'lead' or type = 'false';

We can apply domain on some field like : <field string="Supplier" name="partner_id" domain="[('supplier', '=', True)]"/>

This will give suppliers from res_partner object.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 6/5/13, 5:36 AM
Seen: 3613 times
Last updated: 3/16/15, 8:10 AM