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???
Cette question a été signalée
1
Répondre
10308
Vues
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
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
|
1
oct. 16
|
5761 | ||
|
|
1
sept. 15
|
12230 | ||
|
|
0
oct. 23
|
4893 | ||
|
|
1
oct. 19
|
4095 | ||
|
|
2
juil. 19
|
24522 |
You can change date format according to your needs: http://learnopenerp.blogspot.com/2018/02/python-strftime-datetime-formatting.html