Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
3 Besvarelser
43072 Visninger

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 .

Avatar
Kassér
Bedste svar

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.

Avatar
Kassér
Bedste svar

you can try it

python

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

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

Avatar
Kassér
Forfatter Bedste svar

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.

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
aug. 17
5815
1
dec. 16
6030
3
maj 25
1862
1
apr. 25
1386
3
sep. 24
14362