Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2314 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor

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

Related Posts Răspunsuri Vizualizări Activitate
2
mai 25
9879
3
mar. 24
5539
1
ian. 21
3543
0
ian. 25
1316
1
ian. 25
1657