As of OpenERP 6.1, the time zone of all Python operations occurring on the server side (and in the modules) is forced to be UTC. It was a constructive solution, explained in different places [1] . The countdown of the date and time values ββin the user time zone is intended exclusively for the client side.
There are very few cases where it makes sense to use the user's time zone instead of UTC on the server side, but, indeed, printing the date and time values ββinside the reports is one of them, since the client side will not be able to convert the contents of the final report.
To do this, the reporting mechanism provides a utility method for this: the formatLang() method, which is provided in the context of reports (at least based on RML), will format the date in accordance with the user's time zone if you call it datetime and date_time=True (it uses the tz context variable passed in RPC calls and based on user time zone preferences) You can find an example of how this is used in official add-ons, for example, in the delivery module (l.171) .
Check out the formatLang() implementation if you want to know how the conversion actually does it.
[1]: see OpenERP release notes for 6.1, this other question , and also comment No. 4 on bug 918257 or bug 925361 .
odony source share