Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
9721 Переглядів

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

Аватар
Відмінити
Найкраща відповідь

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.

Аватар
Відмінити
Найкраща відповідь

Hi,

Domain notation using multiple and nested '|' and '&'

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
вер. 18
9643
1
черв. 15
5939
3
трав. 24
6130
2
груд. 21
6241
2
трав. 24
3971