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 />
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 1 25
|
1032 | ||
|
1
thg 7 23
|
2868 | ||
|
1
thg 9 22
|
1322 | ||
|
0
thg 5 20
|
2582 | ||
|
3
thg 3 15
|
10337 |