Odoo Help

Welcome!

This community 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.

0

exclude admin from domains

By
Karim OUBHAT
on 3/4/16, 5:39 AM 305 views

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? 

1

Axel Mendoza

--Axel Mendoza--
10238
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 3/4/16, 8:39 AM

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

0
Kalpana Hemnani
On 3/4/16, 6:53 AM

Hello Karim,

Double check your domain, it should be ['|', ('user_id', '=', False), ('user_id', '=', 'user.id')] like this.

As well as Administrator concern, he is a super user. no security applies to super user. Admin can view all the records.

Let me know which domain you are applying. 

0

hi,

Axel is right,

you should use in yours record rule like   in rule   [('user_id', '=', uid), ('user_id', '!=', 1)]

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/4/16, 5:39 AM
Seen: 305 times
Last updated: 3/7/16, 11:39 AM