コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
8565 ビュー

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.

アバター
破棄
関連投稿 返信 ビュー 活動
3
7月 25
4391
0
5月 25
916
2
3月 24
2165
0
1月 23
1758
1
11月 22
3220