İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
9981 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

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.

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Eyl 18
9865
1
Haz 15
6154
3
May 24
6585
2
Ara 21
6580
2
May 24
4332