Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
42934 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

you can try it

python

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

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

Avatar
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
srp 17
5737
1
pro 16
5984
3
kvě 25
1706
1
dub 25
1272
3
zář 24
14160