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

Sometimes I found ('','','') expression for domain or ['','',''].

I want to know : Where do I use () or [] for write domain expression?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

The two datatype are equal in this case. If you create a filter you can use tuple or list. The standard is to set the filters as list of tuple. This is an example:

filter = [('name', 'ilike', 'OpenERP'), ('type', '=', 'erp')]
อวตาร
ละทิ้ง
ผู้เขียน

I can use list or tuple in .xml file AND in UI form ?

You can use tuple and list in every point of the software. This type of data are part of python.

ผู้เขียน

thanks for your answer

คำตอบที่ดีที่สุด

Hello Denis,

Domain is a python code for optional restriction in the form of arguments for search.

Syntax:

domain =  [['field_name', 'operator', 'value'], ...]

For example,

domain = [('state','<>','draft'), ('country_id', '=', country_id)]

Thank you.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
naked domain set up แก้ไขแล้ว
3
ก.ค. 25
4395
0
พ.ค. 25
919
2
มี.ค. 24
2165
0
ม.ค. 23
1758
1
พ.ย. 22
3221