Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
15365 Vistas

 I would like to use t-if condition to check whether a field name (Ex.: 'Total Value') contains a string '**Total**'. I tried using:

t-if = 'Total' in a.name but it seems to check whether a.name is equal to 'Total'. 

Avatar
Descartar
Mejor respuesta

Hi,

Try it like this, it normally works

<t t-if="'Total' in a.name">

Avatar
Descartar
Autor

It works, thanks :)

Mejor respuesta

<t t-if="'Total' in a.name">

Correct me,If I am wrong
 Thank you


Avatar
Descartar
Mejor respuesta

My guess is that it should probably be unicode:

<t t-if="u'Total' in a.name">
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
feb 18
3421
0
feb 18
3311
1
jul 25
1726
1
may 25
1730
1
abr 25
2293