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

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.

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

Try this and see,

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

Thanks

الصورة الرمزية
إهمال

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

Thanks

الكاتب أفضل إجابة

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.

الصورة الرمزية
إهمال

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

الكاتب

Hey thanks, that was helpful to know!

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
ديسمبر 23
3957
0
مارس 15
3801
1
مايو 24
2562
2
يناير 24
3136
0
يناير 24
1478