On 07/11/11 22:05 -0800, vuk wrote:
> hello everybody, i have this situation:
>
> the COMPANY model with a
> one2many relation to the OFFICE model.
>
> the PLAN model with a
> many2many relation to the COMPANY model and a
> one2many relation to the PROJECT model, with a
> one2many relation to the EDITION model with a
> many2one relation to the OFFICE model.
>
> I would like the selection of offices for an edition to be limited to
> the ones belonging to the companies associated to the 'grandfather'
> plan of the edition, so i tried on the many2one Office field of the
> edition model the domain:
>
> domain=[('Company','in','Project.Plan.Company')] and
> domain=[('Company','in',Project.TrainingPlan.Company)]
>
> but with no luck. I tried to figure out how to set up the domain by
> looking into modelsql.py but got lost among all the search() calls...
You must do something like:
[('Project.Plan.Company', '=', Eval('Company'))]
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgpcBfycIDzQE.pgp
Description: PGP signature
