Tek Siong, Hock
Odoo Error - The requested operation cannot be completed due to security restriction.
Updated: May 27, 2022
One of the most frequent error that would be seen by Odoo user - "The requested operation cannot be completed due to security restriction. Please contact your system administrator". Document type: x, operation: read/write) - Record: [y], User: n].
Lets take the following example to find the root-cause to fix it.
Document type is the Model or Object that is affected.
Record:  is the ID of the record
User: 2 is the ID of the user (res.users)
1) Which model/object's security rule that give the error?
Go to the Technical -> Database Structure Model and look for the "Inventory Locations".
From the model "stock.location", try to look for which "stock.location" record (Records:  ) that is causing the error.
2) Which record that give the error?
Go to the list view of the model and try to find the id=12 and model='stock.location'.
By this point, you may already have some ideas, if the security rule is due to the multi-company security rule, or user group authorization, etc.
3) Which user that had the error?
User: 2 indicate the exact user (res.users) that has been restricted. Go to the User admin page to confirm the exact user that had this error.
4) Which security rule that prompt this error?
Go to the Technical -> Security -> Record Rules. Look for the model name "Inventory Location".
The rule here is the multi-company restriction. You may tentatively remove the rule and test if it is the actual culprit.
5) What if the user lack of access right to model?
Go to the Settings -> Users & Companies -> Group.
Identify which user group that has been assigned to the user and add the access right (object name) accordingly. The best practice is to add the access right to the relevant module's group.