Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2295 Näkymät

Hello all,

i have in my model: 

start_hour = fields.Float(string="start hour", required=True)

how can i display this field in time format hh:mm in the odoo website form

thanks

Avatar
Hylkää
Paras vastaus

Hi,

In the form view, add `widget="float_time"

eg:<field name="start_hour" widget="float_time"/>


Note for the template view, we can use this: 

t-options="{'widget': 'float_time'}"


Hope it helps

Avatar
Hylkää
Tekijä

thanks for your help but:
it's ok for the form view , the problem is in the template view , i tried input type='text' and input type ='number' with t-options="{'widget': 'float_time'}" but i can't have the hh:mm format

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
toukok. 25
9869
3
maalisk. 24
5534
1
tammik. 21
3537
0
tammik. 25
1311
1
tammik. 25
1653