summaryrefslogtreecommitdiff
path: root/openerp/__init__.py
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2013-03-07 13:16:37 +0100
committerVo Minh Thu <vmt@openerp.com>2013-03-07 13:16:37 +0100
commit4a77c6a0c5bdbcc3a5dae48dc73caa0fa4550430 (patch)
tree980434a64118ea80493ea4780c9c622fc5f633a3 /openerp/__init__.py
parent9bb7ff34134805b37ecb027c12462246c44e5fff (diff)
[FIX] timezone: under windows os.environ["TZ"] was not affecting the server,
now it does (probably because we make sure to first set the environment *then* import the time module. Works fine under Windows XP. lp bug: https://launchpad.net/bugs/1038017 fixed bzr revid: vmt@openerp.com-20130307121637-47fac72clykizlnj
Diffstat (limited to 'openerp/__init__.py')
-rw-r--r--openerp/__init__.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/openerp/__init__.py b/openerp/__init__.py
index 1db7b616199..02f879c4929 100644
--- a/openerp/__init__.py
+++ b/openerp/__init__.py
@@ -22,6 +22,17 @@
""" OpenERP core library.
"""
+
+# Make sure the OpenERP server runs in UTC. This is especially necessary
+# under Windows as under Linux it seems the real import of time is
+# sufficiently deferred so that setting the TZ environment variable
+# in openerp.cli.server was working.
+import os
+os.environ['TZ'] = 'UTC' # Set the timezone...
+import time # ... *then* import time.
+del os
+del time
+
# The hard-coded super-user id (a.k.a. administrator, or root user).
SUPERUSER_ID = 1