Skip to Content
Menu
This question has been flagged
2266 Views

While using multi-company I assigned surveys to companys by adding a new company_ids-field in survey.survey which type is Many2many. Now I want to set a filter that only users which are assigend to a company which is assigned to the survey can see them.

If I check with the users actual company it works with:

[('company_ids', 'in', user.company_id.id)] (for survey.survey)

but how can i make a check with all companies the user is assigned to (user.company_ids), not only the actual one (user.company_id)?

I will need something like:

[(any('company_ids'),'in',[i.id for i in user.company_ids])]

or with using of sets:

len(intersection('company_ids', user.company_ids)) > 0


but I find no solution how to do this within a domain 'ir.rule' filter.

Avatar
Discard