Hello all,
We have this new field on the res.partner model :
partner_territory = fields.Many2one('res.territory', string='Partner\'s territory')
We also have this new field on the res.users model :
user_of_territory_ids = fields.Many2many('res.territory', 'res_territory_users_rel', 'user_id', 'territory_id', string='Allowed Territories for this user')
Both new fields work well!
We want to write the domain on the action base.action_partner_form to display ONLY partners with a territory allowed to connected user.
For the moment, I have this domain in this action :
[('partner_territory', 'in', uid.user_of_territory_ids)]
But Odoo says that :
Uncaught Error: AttributeError: object has no attribute 'user_of_territory_ids'
How to write this domain please???
EDIT #1
I have tried these domains, without success :
[ ( 'partner_territory','in',[id for id in uid.user_of_territory_ids[0][2]] ) ]
I always have problem with this kind of domains. One day, I will understand...