Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
8583 Представления

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 Ответы Просмотры Активность
3
июл. 25
4414
0
мая 25
925
2
мар. 24
2171
0
янв. 23
1760
1
нояб. 22
3226