summaryrefslogtreecommitdiff
path: root/odoo-bin
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2017-01-03 11:50:08 -0800
committerNicolas Lempereur <nle@odoo.com>2017-01-06 14:19:09 +0100
commit07bf7bf4f3af49f18a06000ef50ef90d8ad90224 (patch)
treec3a10087c038b931f008ed2d38fd97c0a7048825 /odoo-bin
parent56c798a323d6d0fb50f3b3f66719931229913d75 (diff)
[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
Diffstat (limited to 'odoo-bin')
-rwxr-xr-xodoo-bin3
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo-bin b/odoo-bin
index b2a0e17ff83..2670299b150 100755
--- a/odoo-bin
+++ b/odoo-bin
@@ -1,4 +1,7 @@
#!/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