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

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
4400
0
трав. 25
920
2
бер. 24
2167
0
січ. 23
1758
1
лист. 22
3221