Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2745 Widoki

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?





Awatar
Odrzuć

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

https://learnopenerp.tumblr.com/

Najlepsza odpowiedź

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!

Awatar
Odrzuć
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.

Powiązane posty Odpowiedzi Widoki Czynność
1
mar 16
3828
2
lip 15
4132
1
lut 23
2288
1
lip 17
3996
2
lip 25
1593