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???
Esta pergunta foi sinalizada
1
Responder
10293
Visualizações
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
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscrever-se| Publicações relacionadas | Respostas | Visualizações | Atividade | |
|---|---|---|---|---|
|
|
1
out. 16
|
5760 | ||
|
|
1
set. 15
|
12228 | ||
|
|
0
out. 23
|
4891 | ||
|
|
1
out. 19
|
4094 | ||
|
|
2
jul. 19
|
24511 |
You can change date format according to your needs: http://learnopenerp.blogspot.com/2018/02/python-strftime-datetime-formatting.html