Allow to customize server timezone
issue2449 review246001
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -86,3 +86,6 @@ jsonrpc = localhost:8000
|
||||
|
||||
# Default database language code
|
||||
# language = en_US
|
||||
|
||||
# Timezone of the server
|
||||
# timezone = False
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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', 'Български'),
|
||||
|
||||
Reference in New Issue
Block a user