Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
8716 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
paź 16
3911
1
wrz 15
10506
0
paź 23
2861
1
paź 19
2692
2
lip 19
21773