This question has been flagged
2 Replies
2979 Views

Hello,

I am wondering is it possible to trigger rule only if user is in two groups. Field "groups" can have many groups, but this rule works if I am in at least one of them. I want that it will work only if I am in ALL groups. 

Below is example of code that not works as I want.

<record id="my_special_rule" model="ir.rule">
    ...
    <field name="groups" eval="[(4, ref('my_module.group1')), (4, ref('my_module.group2'))]"/>
    ...
</record>
Avatar
Discard
Best Answer

Path of least resistance may be to create an additional group (for example "my_module.group3") which you can either manually assign if the user is in group1 and group2, or you could automate group3 to be assigned to users if group1 and group2 are assigned provided you have enough users to warrant this level of work.

Avatar
Discard
Best Answer

Please Share The Solution's code if you've found one

Avatar
Discard