Community mailing list archives
Re: How to use domain in a Many2oneby
Pedro M. Baeza
Weel, you have provided the context, but I supposed that you have a field company_ids in the same model/view, so the correct expresion is:Regards.
current_company = fields.Many2one('res.company',domain="[('id','in', company_ids)]")Take care, that this makes you add always in the view both fields when you add current_company in that view.
2015-05-19 14:13 GMT+02:00 Anders Wallenquist <firstname.lastname@example.org>:
I'm trying to use domain to limit the choices in the drop down of a Many2one-field: current_company = fields.Many2one('res.company',domain="[('id','in',[c.id for c in company_ids])]") I got this error Error: Expected "]", got "(name)" What wrong am I doing? Regards, Anders Wallenquist