Skip to Content
Menú
This question has been flagged
1 Respondre
8699 Vistes

Hi, this is my code:

In models.py:

%%%something here%%%
my_field = fields.DateTime('MyField')
%%%something here%%%

In views.xml:

%%%something here%%%
<tree>
%%%something here%%%
<field name="my_field" />
%%%something here%%%
</tree>
%%%something here%%%

I just want to hide seconds for my_field in this tree view. I did some research but everything i found was about qweb or python. Is it possible in this context???

Avatar
Descartar
Best Answer

Rolando

datetime.strptime(Date, '%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d %H:%M')

It will appear date without seconds. (as a string not date time)

Thank You

Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
d’oct. 16
3901
1
de set. 15
10492
0
d’oct. 23
2854
1
d’oct. 19
2674
2
de jul. 19
21762