跳至内容
菜单
此问题已终结
1 回复
2319 查看

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

形象
丢弃
最佳答案

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

形象
丢弃
编写者

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

相关帖文 回复 查看 活动
2
5月 25
9881
3
3月 24
5540
1
1月 21
3546
0
1月 25
1318
1
1月 25
1658