Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2290 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 25
9868
3
มี.ค. 24
5533
Website form field conditions แก้ไขแล้ว
1
ม.ค. 21
3535
0
ม.ค. 25
1311
1
ม.ค. 25
1653