Odoo Help


How to print the correct datetime in report qweb ?

Anabela Damas
on 6/19/15, 11:01 AM 1,803 views


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




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.
Versão Integral, Anabela Damas
on 6/22/15, 4:44 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 6/19/15, 11:01 AM
Seen: 1803 times
Last updated: 6/20/15, 1:32 AM