Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
6 Răspunsuri
17671 Vizualizări

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?.

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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.
Imagine profil
Abandonează
Autor

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'}"/>

Autor

Hi Peter,

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

this code will not worked