Hi, I have a model of incidents with this field:-
team_ids = fields.Many2many( 'moderation.team', relation='incident_incident_moderation_team_rel', string='Moderation Teams', column1='incident_incident_ids', column2='moderation_team_ids', ondelete='restrict', required=True)
And each logged in user will have a field called 'team_ids' that contains the teams that they are assigned to.
team_ids = fields.Many2many('moderation.team', relation='res_users_moderation_team_rel', column1='res_user_ids', column2='moderation_team_ids')
Now I want to create a record rule in the security.xml that will allow only those users who have in their 'user.team_ids' field, at least one of the team_ids that has been assigned to the incident record.
I've tried a few things but my problem is that I don't understand the structure of these data types and I'm struggling. How do I write this record rule?
Reference: http://learnopenerp.blogspot.com/2018/12/add-domain-on-many2many-field-in-odoo.html