Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
21187 Weergaven

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.

Avatar
Annuleer
Beste antwoord

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'}" />

Avatar
Annuleer
Beste antwoord

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

Avatar
Annuleer
Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 15
7128
3
dec. 16
17245
3
jun. 15
26871
0
apr. 15
3752
1
apr. 25
1278