Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
43156 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

you can try it

python

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

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

Avatar
Abbandona
Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
ago 17
5857
1
dic 16
6050
3
mag 25
1964
1
apr 25
1483
3
set 24
14493