跳至內容
選單
此問題已被標幟
1 回覆
8695 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
10月 16
3899
1
9月 15
10492
0
10月 23
2853
1
10月 19
2673
2
7月 19
21761