Skip to Content
Menu
This question has been flagged
2 Replies
11333 Views

I am new to Odoo and domain filters and everything else. So bear with me if I am missing something obvious. 

I have a request model that contains a list of valid team_ids. The currently logged in user has a single team_id assigned to them. I want to create a record rule for the requests which will check if a request has a list of team_ids that contains the team_id of the currently logged in user. I would write the domain filter like this:-

[('team_ids', 'includes',user.team_id)]

but I am aware that the there is no such operator as 'includes'. 

What operator do I use here to get this to work. I hope my question is clear.

Avatar
Discard
Best Answer

Hi,

Try this and see,

[('team_ids', 'in', [user.team_id.id])]

Thanks

Avatar
Discard

And if I want that the many2many field (tags) contains more than one?

Thanks

Author Best Answer

So, because I don't have the needed karma points, I can't vote up, comment or mark an answer as resolved. The only thing I can do to communicate is to create an answer. This is really stupid.

But anyway, Niyas Raphy's answer worked and anyone who can mark it as the resolution, please do so and I will remove this answer after that. 

Also, if you can, please upvote this answer so that I get the karma points needed to do things on my own.

Avatar
Discard

You can get karma easily by completing the slides/course provided by odoo(free course), Please check this link: https://www.odoo.com/slides

So that you will get more than enough karma to do operations:

Also see this: https://www.youtube.com/watch?v=UgtNk2mIYdk

Author

Hey thanks, that was helpful to know!

Related Posts Replies Views Activity
1
Dec 23
3456
0
Mar 15
3608
1
May 24
2252
2
Jan 24
2652
0
Jan 24
1168