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

Hi

    any one knows how to get only time in a field like fields.Time() to store only time that i select

i want a field which can store only time .

الصورة الرمزية
إهمال
أفضل إجابة

Hi,

You can add Time fields through this way

Python:

time = fields.Float(string='Time', compute="_compute_time")

Xml:

<field name="time" widget="float_time"/>

You can calculate the time using the compute function.

Thank you.

الصورة الرمزية
إهمال
أفضل إجابة

you can try it

python

time = fields.float('Duration in hours ')

 view
<
field name='time' widget='float_time' />

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

thank you but

<field name="time" widget="float_time"/>

i try it before ,it shows value in formate like (11:56) and want to store value in like (11:52:12) format, and value is selected  by user like happening  in datetime field.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أغسطس 17
5679
1
ديسمبر 16
5955
3
مايو 25
1643
1
أبريل 25
1241
3
سبتمبر 24
14110