Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2688 Vistas

In my database, I have 2 companies and three-level users.

admin level, manager level, salesperson. (Company A and Company B)

The salesperson can see all customer by the record rule : ['|',('user_id','=',user.id),('user_id','=',False)]

Manager level wants to see all customers in that particular branch by the record rule : [('company_id','in',[user.company_id.id])]

Admin level user by the reord rule : [(1,'=',1)]


But my question is that I need to hide some personal customers of admin-level from manager level user? In the above record rule, manager-level users can see all the customers in that particular company including personal customers of the admin also. 

How can I hide the personal customer of admin users?

How is it possible?





Avatar
Descartar

These tips help you to get the basic idea about customization in odoo

https://learnopenerp.tumblr.com/

Mejor respuesta

To prevent the manager seeing the customers of the System Admin account, you need a domain something like this:

['&', 

('company_id','in',[user.company_id.id]),
("user_id.id","!=",2)]

Note: In earlier versions of Odoo, the Admin account is id=1

EDIT: So you mean the Sales Administrator, not System Admin. I can't think of any way to do this without any customization.

Two suggestions to consider:   

  1. Add a new boolean field to the user profile to identify Sales Administrators and use that in the Record Rule

  2. Hard-code the Record Rule based on the User IDs of the Sales Administrators

Other people smarter than me might know how to do this in a simpler way!

Avatar
Descartar
Autor

But actually, in my case some set of customers are personal. Remaining all should be view by the manager. Then how can I use the above record rule? Can you please suggest any other solution?

Do you mean that some of the customers of the salesperson should be private and not visible to the manager? How to identify which are private customers?

Autor

Some of the customers of admin-level users should be private and not be visible to the manager and salesperson. I don't know-how I sort this issue? Can you suggest any solution? Whether it is possible through record rule?

Added something to my answer.

Autor

Thank you. Will try with it.

Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 16
3788
2
jul 15
4096
1
feb 23
2238
1
jul 17
3956
2
jul 25
1538