How to show widget="float_time" in Qweb Report ?
I want to show the time difference in Qweb Report. I already have a field in the database with widget float_time and I want to show the same in Report.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How to show widget="float_time" in Qweb Report ?
I want to show the time difference in Qweb Report. I already have a field in the database with widget float_time and I want to show the same in Report.
If anyone finds this old question (as I just did), the option is now implemented (at least since version 12). The syntax is:
<span t-field="your_field" t-options="{'widget': 'float_time'}" />
Try:
<t t-esc="'%02d:%02d' % (int(your_field), your_field % 1 * 60)" />
If
<span t-field="your_field" t-field-options='{"widget": "float_time"}' />
is still not implemented
not beautiful but it works
<t t-set="delay" t-value="1.5" />
<t t-esc="'%s:%s' % (str(delay).split('.')[0], int(float(str('%.2f' % delay).split('.')[1])/100*60))" />
Don't think that it's native in Odoo
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 | |
---|---|---|---|---|
|
1
thg 3 15
|
7150 | ||
|
3
thg 12 16
|
17258 | ||
|
3
thg 6 15
|
26885 | ||
|
0
thg 4 15
|
3759 | ||
|
1
thg 4 25
|
1287 |