Actually I'm creating a two rules for employees groups and one for manager group
For manager:
<record model="ir.rule" id="employee_view_rule_manager">
<field name="name">Manager view rule</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="groups" eval="[(4, ref('hr.group_hr_manager'))]" />
<field name="domain_force">[(1,'=',1)]</field>
</record>
For employees:
<record model="ir.rule" id="employee_view_rule_employee">
<field name="name">Employee view rule</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="groups" eval="[(4, ref('base.group_user'))]" />
<field name="perm_create" eval="False"/>
<field name="domain_force">[('user_id', '=', user.id)]</field>
</record>
whenever i login as a employee its show only my record that's good but i can not access it its give me an error
The requested operation cannot be completed due to security restrictions. Please contact your system administrator.
(Document type: hr.employee, Operation: read)