Community mailing list archives

Re: How to use domain in a Many2one

Pedro M. Baeza
- 05/19/2015 08:29:56
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:

current_company = fields.Many2one('',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 <>:
I'm trying to use domain to limit the choices in the drop down of a Many2one-field:

current_company = fields.Many2one('',domain="[('id','in',[ for c in company_ids])]")

I got this error

Error: Expected "]", got "(name)"

What wrong am I doing?


Anders Wallenquist

Post to: