Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
2727 Visninger

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
Kassér

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

https://learnopenerp.tumblr.com/

Bedste svar

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
Kassér
Forfatter

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?

Forfatter

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.

Forfatter

Thank you. Will try with it.

Related Posts Besvarelser Visninger Aktivitet
1
mar. 16
3811
2
jul. 15
4114
1
feb. 23
2266
1
jul. 17
3981
2
jul. 25
1589