Reputation: 10189
I'm trying to set a rule for a specific group created by me (named group_order_admin
) in the model res.partner
. Belonging to this group implies to belong also to the group base.group_sale_salesman
(See Own Leads).
I want that the users who belong to that group cannot create, update or unlink supliers, but they will be able to read them (Note: supplier is a res.partner
record with the supplier
field set to True).
So I wrote the next rule:
<record model="ir.rule" id="res_partner_order_admin_suppliers">
<field name="name">res_partner: order admin cannot create or update suppliers</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="domain_force">[('supplier', '=', True)]</field>
<field name="groups" eval="[(4, ref('my_roles.group_order_admin'))]"/>
<field name="perm_read" eval="True"/>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
</record>
But this rule is not wotking at all. The users who belong to group_order_admin
can create, update or remove suppliers.
Can anyone help me? How could I achieve my purpose?
Upvotes: 0
Views: 46
Reputation: 1999
Try by having the value to 'True' for perm_write, perm_create & perm_unlink. By coding above rule, you are specifying that this rule applies only when you try to read the model 'res.partner', not when you create, edit or unlink the record. Also I think you need to have your domain as ['supplier','=', False]
Upvotes: 1