-1

I am getting the below Odoo Server Error - Access Error

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: hr.employee, Operation: read)

Actually I created a rules for employees and manager 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> 

It is working properly without installing hr_org_chart but when we install hr_org_chart app it gives read access error.

I need solution because we want organizational chart also.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
gallory
  • 11
  • 4
  • Did you look into the rules or access rights of module/app hr_org_chart? Maybe you have new rules with it, which make your rules ineffective. – CZoellner Jan 14 '19 at 09:11
  • learn in the documentation of odoo, it have all the basic flows and functionalities or you need basic tutorials there are many websites to learn. For me i suggest http://glowodooerp.blogspot.com/ – Navi Jan 19 '19 at 10:53

1 Answers1

0

i think you have issues of your domain

<field name="domain_force">[(1,'=',1)]</field>

if you apply this domain the employee can see own record only so you want child of employee list so you will use "child_of" try blow think it's will be work.

   <field name="domain_force">[('id', 'child_of', [user.id])]</field>

Thanks

Jainik Patel
  • 2,284
  • 1
  • 15
  • 35