This question has been flagged

Setup:

  • Enable Multi-company setup but disabled Common Contact Book  and Common Product Catalog options.

  • Create company x and company z. both company has no parent company

  • Create a User A with access to Company X only
  • Create a User B with access to Company Z only

Expected:

  • User A should not be able to access Company Z employees
  • User B should not be able to access Company X employees

Findings:

  • User A can access Company Z employees
  • User B can access Company X employees

Is our findings the default behavior for employee module in multi-company setup? Or our setup is wrong?? Is there a way to achieve our expected behavior?

Avatar
Discard
Best Answer

Add a security rule to filter the employees according to the company.

Goto Settings -> Security -> Record Rules -> Create, Select the Employee Object and

Add this filter in Rule Definition.

[('company_id', '=', user.company_id.id)]


Avatar
Discard
Author

Thank you for replying. This one worked but would prompt access error when accessing our old employees as shown below

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

(Document type: Contact, Operation: read) - (Records: [41], User: 6)

You should update companies in employee master anyway and I just gave u an example. Update that according to your needs. 

On Thu, 12 Sep 2019, 2:30 pm Ezra, <jasmen@apollo.com.ph> wrote:

Thank you for replying. This one worked but would prompt access error when accessing our old employees as shown below

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

(Document type: Contact, Operation: read) - (Records: [41], User: 6)

Envoyé par Odoo S.A. using Odoo.