Files
odoo_source/odoo-bin
T
Nicolas Lempereur 07bf7bf4f3 [FIX] odoo-bin: server UTC timezone on windows
On UNIX, the timezone modules conversions can be reset by using
`time.tzset()`. On windows this is not available and the timezone (TZ)
environment variable must be set before the first import of time module.

If not, all datetime gotten in python without specifying UTC (such as
datetime.datetime.now) could be wrong.

This was fixed with 4a77c6a0 in 2013, but has come back since 389c2ba97b
imported pkg_resources (which do  a `time` module import) before that.

closes #14926
opw-693764
2017-01-06 14:19:09 +01:00

10 lines
240 B
Python
Executable File

#!/usr/bin/env python
# set server timezone in UTC before time module imported
__import__('os').environ['TZ'] = 'UTC'
__import__('pkg_resources').declare_namespace('odoo.addons')
import odoo
if __name__ == "__main__":
odoo.cli.main()