Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Is there a way to skip access rights for specific user?
I am in a Multi Company environment and I have two companies Company AB that is a Main Company, Company A and Company B which are the child of Company AB.
Now user of Company A wants to access the records of Company B (In web client and by code). So how to access them or how to skip the access rights for specific user?
Is there a any way/trick to overcome from this by creating some record rules?
Suggestions are most welcome.
Ya you can deceive the access rights for a user... using method "check_access_rights" which returns True if the user has access over an object... if it returns False, then you achieve the same by passing SUPERUSER_ID...
Example: In my case am trying to check whether user has delete permission for Crm.Lead... If he dont have am still proceeding with the action by passing SUPERUSER_ID...
if not self.check_access_rights(cr, uid, 'unlink', raise_exception=False):
lead_obj.unlink(cr, SUPERUSER_ID, lead_ids, context=context)
lead_obj.unlink(cr, uid, lead_ids, context=context)
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 8/1/13, 3:21 AM|
|Seen: 1299 times|
|Last updated: 9/30/17, 6:20 AM|