تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2302 أدوات العرض

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
مايو 25
9873
3
مارس 24
5534
1
يناير 21
3540
0
يناير 25
1312
1
يناير 25
1656