Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
8555 Visualizzazioni

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

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

Avatar
Abbandona
Risposta migliore

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')]
Avatar
Abbandona
Autore

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.

Autore

thanks for your answer

Risposta migliore

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.

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
3
lug 25
4384
0
mag 25
915
2
mar 24
2165
0
gen 23
1757
1
nov 22
3220