Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
10514 Представления

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  />


Аватар
Отменить
Автор Лучший ответ

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

 

Аватар
Отменить
Лучший ответ

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?

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
янв. 25
1041
1
июл. 23
2886
1
сент. 22
1322
0
мая 20
2596
3
мар. 15
10355