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???
La domanda è stata contrassegnata
1
Rispondi
10328
Visualizzazioni
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
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati| Post correlati | Risposte | Visualizzazioni | Attività | |
|---|---|---|---|---|
|
|
1
ott 16
|
5769 | ||
|
|
1
set 15
|
12240 | ||
|
|
0
ott 23
|
4905 | ||
|
|
1
ott 19
|
4103 | ||
|
|
2
lug 19
|
24540 |
You can change date format according to your needs: http://learnopenerp.blogspot.com/2018/02/python-strftime-datetime-formatting.html