تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
8568 أدوات العرض

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.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
naked domain set up تم الحل
3
يوليو 25
4391
0
مايو 25
916
2
مارس 24
2165
0
يناير 23
1758
1
نوفمبر 22
3220