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

I have a one datetime field called start_date.

If i fill the  start_date, it will show the date, hour, minute and seconds. eg (09/06/2017 12:55:49)

But i want to show only date, hour, minute and not need seconds. eg (09/06/2017 12:55)

Is there any possibility to show date, hour and minute in datetime field in odoo 10?.

Avatar
Abbandona
Risposta migliore

There is another option for Odoo v13, maybe, add t-options='{"widget": "date"}'

Avatar
Abbandona
Risposta migliore

You'll want to format your date field in the view, if you're inheriting a view you can do:

        <field name="start_date" position="attributes">
<attribute name="t-options">{"format": "dd / MM / yyyy HH / mm"}</attribute> </field>


Note that the `HH` may need to be `hh`, i'm not 100% sure on that one.
Avatar
Abbandona
Autore

Hi Peter,

Thanks. But I am not inheriting a view. I write a new view with state_date datetime field.

Could you please tell me any widgets to solve this problem.

Hi Priyait, then simply define the attribute on your field like so:

<field name="start_date" t-options="{'format': 'dd / MM / yyyy HH / mm'}"/>

Autore

Hi Peter,

I defined attribute on the field, but it still not working.

this code will not worked