0
votes

I'm working in odoo 10, I have to control access to items in kanban view. For example, in customer kanban view, for one user, I want to show all customers, but the user can open only those affected to him.

customers affected to my user (demo) = 5

all customers = 20

in kanban view, we want to display 20 customers, but demo opens only 5 customers, and he doesn't have access to 15.

1
You can create group and assign it to your view.Keval Mehta
And what yiu mean by can open. You mean when hou click the costumer is opened in the form view. Explain can open because if you mean that odoo cannot do because the can always change the view wkthout having to click on the recordCharif DZ
@Tchi-Odoo, The user can open customer means exactlly what you say, we can set this customer unclickable or show a message error " that he is not allowed to open this customer". Thanksahmed hadri
@KevalMehta, But I want to display in the same kanban view all customers, and control access, if customer is affected to me, I can open the form view, if not, in the same kanban view, I can see customers of other odoo users wethout opening them. Thanksahmed hadri

1 Answers

1
votes

For this you can do this logic i'm not going to write code because it takes a lot of time:

 1 - create a new window action to show the clients in canban view only or list too
       because the original action show the records in all views.
 2- create a new kanban view or edit that one to add a button when user click
    on that button call a method on the model check if the user is allowed
    to open the client if Ok open the record in form view or else show error:

This the only way because if you specify the form view in the action the user can change the view anytime so you should remove it from the action.