تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
9870 أدوات العرض

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
يونيو 21
7959
2
أكتوبر 22
6262
Sum on QWeb reports تم الحل
3
مارس 21
43757
1
سبتمبر 16
3914
0
ديسمبر 15
4271