Skip to Content
Menu
This question has been flagged
2 Replies
8564 Rodiniai

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

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

Portretas
Atmesti
Best Answer

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')]
Portretas
Atmesti
Autorius

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.

Autorius

thanks for your answer

Best 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.

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
liep. 25
4389
0
geg. 25
916
2
kov. 24
2165
0
saus. 23
1757
1
lapkr. 22
3220