Skip to Content
मेन्यू
This question has been flagged

I am an admin for our odoo instance.  I am using a multi-company database.  There is no hierarchical relationship between the two companies in the database.  They are treated a separate companies.

When I try to add a company to a new product, Odoo complains with:

Access Error

Uh-oh! Looks like you have stumbled upon some top-secret records. Sorry, <user> (id=2) doesn't have 'read' access to: - Product Variant, Service on Timesheets (product.product: 2) Blame the following rules: If you really, really need access, perhaps you can win over your friendly administrator with a batch of freshly baked cookies.

A couple of things:

1.  The product id of the new product I added is 131, not 2.  I don't know what this has to do with "Service on Timesheets" service product.  So there appears to be some strange relationship with the new product I just added and "Service on Timesheets".

2.  I have read access to Service on Timesheets, I can open it and read and even change things and save it.

3.  The product I just added has no inventory and has not been involved with any stock moves.

4.  I've tried changing the Record Rules for Product ("Product multi-company") and changed:

['|', ('company_id', 'parent_of', company_ids), ('company_id', '=', False)]

to

['|', ('company_id', 'in', company_ids), ('company_id', '=', False)]

But that doesn't fix it and it mess up the product list in that you can no longer filter on Company.

Any help understanding why this error is being displayed would be appreciated.   I figure there is a rule somewhere that needs tweaking.... 

Thanks,
Kevin



Avatar
Discard

Hello Kevin Stallard
can you show example for which product you are trying to add company and configuration of your users (from which user you are trying to add company)? 

Also can you check how many companies you are selected on top right ?
Maybe after that i can help.

Best Answer

Hi,

The error occurs because Odoo enforces multi-company record rules on all products, even when you’re creating a new one. In your case, the rule touches the “Service on Timesheets” product, which has a company assignment that your user cannot fully access, causing the access error. This happens because the standard product multi-company rule uses hierarchical (parent_of) logic, which doesn’t work properly in a flat multi-company setup. Simply changing parent_of to in can fix access but breaks the company filter in product lists. The correct approach is to either set company_id=False for products that should be accessible across companies and/or create a custom record rule using ['|', ('company_id', 'in', user.company_ids.ids), ('company_id', '=', False)] applied to relevant user groups. This ensures that users can create and manage products across multiple independent companies without triggering access errors or losing the ability to filter products by company.


Hope it helps.

Avatar
Discard
Related Posts Replies Views Activity
1
सित॰ 24
3747
0
फ़र॰ 22
2582
2
सित॰ 25
1013
2
सित॰ 25
293
1
अग॰ 25
1290