Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6048 Vistas

Hi

I would like to know how can I use an option of a selection field in a view to show a custom field in a report

For example I have this selection field

mySelection = fields.Selection([
('01', 'Number 1'),
('02', 'Number 2'),
('03', 'Number 3'),
('04', 'Number 4')
],required=True)

And I would like to show in a report a custom field when for example the option 02 is selected

Im trying like this 

<t t-if="doc.mySelection == 'Number 2'">
<span t-field="custom_field"/></t>

But it doesn't show my field

Thank you for the help

Avatar
Descartar
Mejor respuesta

Hi,

Compare using the key, try this.

<t t-if="doc.mySelection == '02'">
<span t-field="custom_field"/></t>


Thanks

Avatar
Descartar
Autor

Thanks, I did that and it worked

Publicaciones relacionadas Respuestas Vistas Actividad
2
sept 24
1479
5
ago 19
46131
4
jun 18
19548
0
jun 18
3038
2
dic 17
16302