0

I have a datetime field and i want to format it to hours, minutes, seconds in the form view like this:

enter image description here

Is this posible, and how to do it?

Thanks.

fudu
  • 617
  • 1
  • 10
  • 19

1 Answers1

1

As far as i can research, we can use this as alternative solution:

Change the field from Datetime to Float:

your_field = fields.Float(string='Your Field')

Then, in the form view, add widget="float_time":

<field name="your_field " widget="float_time"/>

And here's the result: enter image description here

With this, there's no popup to show (It's bad, i know).

But as i mentioned before, this solution is just a alternative solution until we find better solution.

Other answers are welcome.

Note for the report view or email view, we can use this: t-options="{'widget': 'float_time'}"

Thanks.

fudu
  • 617
  • 1
  • 10
  • 19