Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
8702 Представления

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
окт. 16
3902
1
сент. 15
10492
0
окт. 23
2854
1
окт. 19
2674
2
июл. 19
21763