This question has been flagged
2 Replies
1511 Views

Hello every one i am using below code for multiple condition 


asList(asList(asList("state","=", "assigned"),asList("groups_id", "in",groupsId ),"or",asList("user_id","=",userId))),

If you check above code i need AND condition with second set and need OR condition i have put "or" but its gives error 

Please help me. Thanks 


Avatar
Discard
Best Answer

Hi,

It appears that you are attempting to establish a domain condition by means of a nested list structure. The Odoo domain notation does not, however, have the as List method.

You can use the | and & operators directly in the domain list to create a domain condition that uses both the AND and the OR operators.

Example

domain = [['state', '=', 'assigned'],'|','&',['groups_id', 'in', groupsId],['user_id', '=', userId]]

Regards

Avatar
Discard
Best Answer

Try like this,

asList(     asList(
        "&",
        asList("state","=", "assigned"),
        "|",
        asList(asList("groups_id","in",groupsId),
        asList("user_id","=",userId))
    )
 ),


Avatar
Discard