Allow to customize server timezone

issue2449
review246001
This commit is contained in:
Cédric Krier
2012-02-22 11:54:02 +01:00
parent b23a0ba48d
commit 8a01bb2178
4 changed files with 12 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Allow to customize server timezone
* Add richtext widget for WYSIWYG editor
* Add support of fields.Time
* Replace nested view by reference id
+3
View File
@@ -86,3 +86,6 @@ jsonrpc = localhost:8000
# Default database language code
# language = en_US
# Timezone of the server
# timezone = False
+7
View File
@@ -11,6 +11,7 @@ except ImportError:
sys.modules['cdecimal'] = decimal
import os
import ConfigParser
import time
def get_hostname(netloc):
if '[' in netloc and ']' in netloc:
@@ -76,9 +77,15 @@ class ConfigManager(object):
'unoconv': 'pipe,name=trytond;urp;StarOffice.ComponentContext',
'retry': 5,
'language': 'en_US',
'timezone': time.tzname[0] or time.tzname[1],
}
self.configfile = None
def set_timezone(self):
os.environ['TZ'] = self.get('timezone')
if hasattr(time, 'tzset'):
time.tzset()
def update_cmdline(self, cmdline_options):
self.options.update(cmdline_options)
+1 -1
View File
@@ -54,7 +54,7 @@ def dispatch(host, port, protocol, database_name, user, session, object_type,
elif method == 'version':
return VERSION
elif method == 'timezone_get':
return time.tzname[0]
return CONFIG['timezone']
elif method == 'list_lang':
return [
('bg_BG', 'Български'),