Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
3 Respostas
15390 Visualizações

 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
Cancelar
Melhor resposta

Hi,

Try it like this, it normally works

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

Avatar
Cancelar
Autor

It works, thanks :)

Melhor resposta

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

Correct me,If I am wrong
 Thank you


Avatar
Cancelar
Melhor resposta

My guess is that it should probably be unicode:

<t t-if="u'Total' in a.name">
Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
fev. 18
3435
0
fev. 18
3331
1
jul. 25
1735
1
mai. 25
1746
1
abr. 25
2300