It is pretty simple.
Consider the following fields (only the XML provided here, python that you must manage)
<field name="a"/> <field name="b"/> <field name="c"/>
Only condition
Consider some simple programming conditions.
if a = 5
In the Open ERP domain filter window, it will be written this way
[('a','=',5)]
So we get the syntax
('field_name', 'operator', value)
Now try applying a different field instead of a static value of 5
[('a','=',b)]
In the above, you should notice that the first variable a is enclosed in single quotes , while the value of b is not . The variable to be compared will always be the first and will be enclosed in single quotes, and the value will simply be the name of the field. But if you want to compare the variable a with the value "b", you should do below
[('a','=','b')]
Condition AND
In programming
if a = 5 and b = 10
In the "Open ERP Domain Filter" window
[('a','=',5),('b','=',10)]
Please note that if you do not specify any condition at the beginning, the condition and will be applied. If you want to replace static values, you can simply remove 5 and specify the field name ( strictly without quotes )
[('a','=',c),('b','=',c)]
Condition OR
In programming
if a = 5 or b = 10
In the "Open ERP Domain Filter" window
['|',('a','=',5),('b','=',10)]
Please note that , indicates that this condition and . If you want to replace the fields, you can simply delete 5 and specify the field name ( strictly without quotes )
Several conditions
In programming
if a = 5 or (b != 10 and c = 12)
In the "Open ERP Domain Filter" window
['|',('a','=',5),('&',('b','!=',10),('c','=',12))]
Also this post from Arya will be very useful for you. Hooray!!