Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
8728 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Okt 16
3921
1
Sep 15
10514
0
Okt 23
2885
1
Okt 19
2706
2
Jul 19
21784