On 2016-03-07 06:38, Daniela Barroso wrote:
> Hi!
>
> I need to make a selection field that must to change the options basead in
> an other selection field.
> I tried to do with domain and If, but the selection doesn't load the
> options.
>
> doador = fields.Selection([(None, ''),
> ('dv', 'Vivo'),
> ('df', 'Falecido')], 'Doador')
> tipagem_hla = fields.Selection([(None, ''),
> ('idem', u'Idêntico'),
> ('haplo',
> u'Haploidentico'),
> ('dist', u'Distinto'),
> ('miss',
> u'Missmatches')],
> u'Tipagem HLA',
> domain=[(
>
> If((Bool(Eval('doador') == 'dv')),
>
> ([('tipagem_hla', '=', None),
>
> ('tipagem_hla', '=', 'idem'),
>
> ('tipagem_hla', '=', 'haplo'),
>
> ('tipagem_hla', '=', 'dist')]),
>
> ([('tipagem_hla', '=', None),
>
> ('tipagem_hla', '=', 'idem'),
>
> ('tipagem_hla', '=', 'haplo'),
>
> ('tipagem_hla', '=', 'dist'),
>
> ('tipagem_hla', '=', 'miss')])))] )
>
> Can anyone help me?
With your domains, there are no value ever possible.
The field tipagem_hla can not be None and 'idem' and 'haplo' and 'dist'
at the same time.
domain lists with no initial operator are 'AND'.
see: http://doc.tryton.org/3.8/trytond/doc/topics/domain.html
--
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/20160308152747.GR25642%40tetsuo.