Community mailing list archives

community@mail.odoo.com

Re: How to use domain in a Many2one

by
Andrei Levin
- 05/19/2015 12:45:00
BTW, [c.id for c in company_ids] is equal to company_ids.ids

Cheers

2015-05-19 18:33 GMT+02:00 Pedro Manuel Baeza Romero <pedro.baeza@gmail.com>:
> What I said, I don't have enought context to say. Put more information.
>
> Regards.
>
> 2015-05-19 16:12 GMT+02:00 Anders Wallenquist
> <anders.wallenquist@vertel.se>:
>>
>> Den 2015-05-19 14:35, Pedro Manuel Baeza Romero skrev:
>> 
> cite="mid:CACSANCASbbbrXC0QAVhCYGm9N5tH5jdMTWFQrCTp+7ZSHP1ryg@mail.gmail.com" >> type="cite"> >> 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('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. >> Thanks, but I got this error intead: >> >> TypeError: not all arguments converted during string formatting >> >> >> >> Regards, >> >> Anders >>
> cite="mid:CACSANCASbbbrXC0QAVhCYGm9N5tH5jdMTWFQrCTp+7ZSHP1ryg@mail.gmail.com" >> type="cite"> >> >> Regards. >> >> 2015-05-19 14:13 GMT+02:00 Anders Wallenquist >> <anders.wallenquist@vertel.se>: >>> >>> 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 >>> >>> _______________________________________________ >>> Mailing-List: https://www.odoo.com/groups/community-59 >>> Post to: mailto:community@mail.odoo.com >>> Unsubscribe: https://www.odoo.com/groups?unsubscribe >> >> >> _______________________________________________ >> Mailing-List: https://www.odoo.com/groups/community-59 >> Post to: mailto:community@mail.odoo.com >> Unsubscribe: https://www.odoo.com/groups?unsubscribe >> >> >> _______________________________________________ >> Mailing-List: https://www.odoo.com/groups/community-59 >> Post to: mailto:community@mail.odoo.com >> Unsubscribe: https://www.odoo.com/groups?unsubscribe > > > _______________________________________________ > Mailing-List: https://www.odoo.com/groups/community-59 > Post to: mailto:community@mail.odoo.com > Unsubscribe: https://www.odoo.com/groups?unsubscribe -- Didotech Srl Via T.Aspetti, 248 35133 Padova (PD) Tel 049 8592286 Cell.: 347-2426694 www.didotech.com