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

I am having problem of getting a value in QWeb template based on a session and model field for example

<t t-set="foo" t-value=lang direction of the current session language  />


Avatar
Cancelar
Autor Melhor resposta

After long search I found a solution for value=lang direction of the current session language in a template


<t t-set="dir" t-value="env['res.lang']" />

<html style="height:100%" t-att-dir="dir.search([('code', '=', env.lang)], limit=1).direction">


This means I can query any model with and an Environment variable

 

Avatar
Cancelar
Melhor resposta

I have no difficulty to do such thing. I follow this guide:

https://www.odoo.com/nl_NL/forum/help-1/question/how-do-you-use-variables-in-a-qweb-loop-67687 

What value do you want to show exactly?

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
0
jan. 25
1035
1
jul. 23
2877
1
set. 22
1322
0
mai. 20
2587
3
mar. 15
10346