How to restrict leads visibility to those of the user sales channel
I have set three sales channels in odoo 11 Sales module, and i have put a user as a member in each one.
I was trying to write a record rule in order to restrict the leads visibilitity to each user´s sales channel.
I have created a new group, "Sales/ Manager(Copy)" and inherited from "Sales/ User:Own documents only"
And I wrote a record rule for the Leads/Opportunity object:
[('team_id', 'in', user.team_ids.ids)]
I know that it is not correct because user.teams_ids is not really in the "view fields" section.
There is only a field named user.team_id, which I don´t understand, because each team can have many users, so a user may be in one or more teams... So what is the user.team_id for?
¿How could I restrict leads visibility to those sales channels where the user is as a member?
Any help would be appreciated!!
Thankyou very much for your time!