In odoo 16, I have a request model that has a one2many line_ids field.
I want to restrict access to the request record if the user has no access on at least one line. How to do that?
Let’s say the access to the line is determined by a boolean field:
line rule:
[('has_access', '=', True)]
I tried this domain in a request record rule:
[('line_ids.has_access', '=' , True)]
but the user was still allowed to open the request (even if some lines were hidden).
I tried a computed field that uses check_access_rule('read')
but also with no help.
In short: I want to prevent the user from access a ‘request’ record if there is at least one line the user doesn’t have access to.
Please help and thank you.
1