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

Hi, 

I'm creating my first qweb report and when I do this :
<span t-field="o.date_start" t-field-options='{"format": "d-MM-Y h:m"}'/>

It prints a different hour from the hour displayed in the form view to my user, I think that prints the time of the server and not the time in the timezone of the user .

In v7 we can use the:

<para style="P2">[[ setLang(o.partner_id.lang) ]]</para>

<para style="terp_default_Centre_8">[[ formatLang(o.date,date_time=True) ]]</para>

How can we do this in v8 (qweb)? 

Thanks

頭像
捨棄
最佳答案

Hi,

you can use following things to get your desire result.

<p t-esc="formatLang(o.date_start, date_time=True)" />

I hope it will useful to you.

頭像
捨棄
作者

I get this error: QWebException: ""'NoneType' object is not callable" while evaluating 'formatLang(o.date_start, date_time=True)'" while evaluating I try to do this before :

but that doesn't work.
相關帖文 回覆 瀏覽次數 活動
1
6月 21
7968
2
10月 22
6269
3
3月 21
43781
1
9月 16
3929
0
12月 15
4281