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)

-- 
Korbinian Preisler
____________________________________
virtual things
Preisler & Spallek GbR
Munich - Aix-la-Chapelle

Windeckstr. 77
81375 Munich - Germany
Tel: +49 (89) 710 481 55
Fax: +49 (89) 710 481 56

[email protected]
http://www.virtual-things.biz

-- 
[email protected] mailing list

Reply via email to