コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
21198 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
3月 15
7134
3
12月 16
17247
3
6月 15
26876
0
4月 15
3756
1
4月 25
1281