Skip to Content
Menu
This question has been flagged
1 Atsakyti
8714 Rodiniai

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

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
spal. 16
3911
1
rugs. 15
10506
0
spal. 23
2857
1
spal. 19
2689
2
liep. 19
21770