Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
42706 Vues

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
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse

you can try it

python

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

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

Avatar
Ignorer
Auteur Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
août 17
5572
1
déc. 16
5880
3
mai 25
1457
1
avr. 25
1122
3
sept. 24
13898