Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
8710 Visninger

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
Kassér
Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
okt. 16
3909
1
sep. 15
10505
0
okt. 23
2857
1
okt. 19
2682
2
jul. 19
21770