Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2298 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 25
9871
3
thg 3 24
5534
1
thg 1 21
3538
0
thg 1 25
1311
1
thg 1 25
1655