Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
9709 มุมมอง

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
9635
optional parameter fields/property แก้ไขแล้ว
1
มิ.ย. 15
5931
3
พ.ค. 24
6108
One2many field domain not working แก้ไขแล้ว
2
ธ.ค. 21
6226
2
พ.ค. 24
3968