On 04/11/11 12:44 +0100, Korbinian Preisler wrote:
> Am Freitag, den 04.11.2011, 04:21 -0700 schrieb vuk:
> > when I try to create a new subdvision record from the
> > TrainingStaff_form_birth page (AFTER the country field has been set
> > and using the 'Create new record' button on the right of the
> > subdivision field) the Subdvision form pops up with the Name, Code,
> > Type and Parent fields. When I fill the fields and click the OK button
> > i get the error 'The field "Country" on "Subdvision" is required'.
> > I thought that the context={'country':Eval('country') set on the
> > May2One subdvision field could get the value of the country field of
> > the train.TrainingStaff model but evidently it doesn't...what am i
> > missing?
> >
> > thanks for any help
> >
> Hi,
>
> you need to create a default_function for the country field on the model
> train.TrainingStaff.
>
> def default_country(self):
> return Transaction().context.get('country', False)Context on fields will be removed in the future as we got domain inversion. -- 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/
pgpmlf3F8vXG9.pgp
Description: PGP signature
