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.
i'm working on a helpdesk module, and i'm appliying domains on users. So that each user can see only his records, but the problem is that domains apply to admin too.
How can i exclude admin from domain on users?
Hi Karim OUBHAT
All depends where you are applying your domains. If they are used for ir.rules records in the security you could use the answer of @Kalpana Hemnani, because the admin bypass the security record rules. But if you are applying the domain directly on the target field, action or whatever object you are using for but not for security rules then the domain apply to all the users as a business rule so you indeed need to include the admin for your domain. Think that the admin always will have the id = 1 so you could check that if the user is not 1, for example:
[('user_id', '=', uid), ('user_id', '!=', 1)]
that checks to only display the record for the actual user and that the actual user is not the admin, you could merge this domain using and '|' with your existing domain.
I repeat, this is only if you are not using ir.rule security records
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: 3/4/16, 5:39 AM|
|Seen: 740 times|
|Last updated: 3/7/16, 11:39 AM|