1 year ago
#373621
Ernesto Ruiz
Odoo, how to make that an user can only see his partners (through parent_id field)
In Odoo every partner has a parent_id field. In my Odoo app I want to make that an user can only see their contacts (partners). That means that an user can only see those contacts in which they are the parent contact. I created the following record rule for this purpose, but it is not working, the user can see all contacts, whether they are the parent or not. What am I doing wrong?
<record model="ir.rule" id="portabilidad_client_record_rule">
<field name="name">See only His client</field>
<field name="model_id" ref="model_res_partner"/>
<field name="domain_force">[('parent_id.id','=',user.partner_id.id)]</field>
<field name="groups" eval="[(4, ref('portabilidad_store'))]"/>
</record>
odoo
odoo-12
0 Answers
Your Answer