Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
11726 Vistas

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
Descartar
Mejor respuesta

Hi,

Try this and see,

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

Thanks

Avatar
Descartar

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

Thanks

Autor Mejor respuesta

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
Descartar

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

Autor

Hey thanks, that was helpful to know!

Publicaciones relacionadas Respuestas Vistas Actividad
1
dic 23
3944
0
mar 15
3793
1
may 24
2547
2
ene 24
3123
0
ene 24
1468