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

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 17
5776
field does not exist PROBLEM แก้ไขแล้ว
1
ธ.ค. 16
5999
3
พ.ค. 25
1760
1
เม.ย. 25
1295
one2one relational field แก้ไขแล้ว
3
ก.ย. 24
14214