跳至內容
選單
此問題已被標幟
2 回覆
10319 瀏覽次數

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?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
1月 25
921
1
7月 23
2741
1
9月 22
1322
0
5月 20
2455
3
3月 15
10218