On 14 May 09:04, Mariano Ramon wrote:
> Hello, good afternoon everyone
>
> I have two many2one field defined with default options like this. In a
> model
>
> profesional = fields.Many2One('gnuhealth.healthprofessional',
> 'Profesional', required=True)
> especialidad = fields.Many2One('gnuhealth.specialty','Especialidad',
> help='Especialidad')
>
> both profesional and specialidad are related. But the posible options of
> especialidad depends on what's set on profesional. Is there any way to
> dinamically select which of all the especialidad records can be found when
> searching?
> is this possible to do before saving?
You have to define a domain on 'especialidad' field which use the value
of 'profesional' using the PySON: Eval('profesional', -1)
--
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/