How To Filter Many2one Res.parner Field In Odoo
I have x_trainer_id = fields.Many2one('res.partner', string='Trainer') field, and I want to filter data in it by the value that is put in category_id tag field in partner form.
Solution 1:
If i understand this correct, try to define you field in your view like:
<field name="x_trainer_id" domain="[('category_id','=',category_id[0][2])]" />
The field category_id
has to be defined in that view, too. But if you extend the res.partner views, there shouldn't be any problem.
Post a Comment for "How To Filter Many2one Res.parner Field In Odoo"