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???
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
1
Responder
8458
Vistas
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
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
InscribirsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
1
oct 16
|
3703 | ||
|
1
sept 15
|
10166 | ||
|
0
oct 23
|
2446 | ||
|
1
oct 19
|
2483 | ||
|
2
jul 19
|
21358 |
You can change date format according to your needs: http://learnopenerp.blogspot.com/2018/02/python-strftime-datetime-formatting.html