diff --git a/.travis.yml b/.travis.yml index ca96d060f..841f6d82a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,8 +34,8 @@ install: - pip install python-ldap - pip install unidecode - pip install validate_email - - printf '[options]\n\nrunning_env = dev' > ${HOME}/.openerp_serverrc - - ln -s server_environment_files_sample ./server_environment_files + - printf '[options]\n\nrunning_env = dev\n' > ${HOME}/.openerp_serverrc + - ln -s ${TRAVIS_BUILD_DIR}/server_environment_files_sample ${TRAVIS_BUILD_DIR}/server_environment_files script: - travis_run_tests diff --git a/base_external_dbsource/base_external_dbsource.py b/base_external_dbsource/base_external_dbsource.py index 9beb69e9e..60047f7a1 100644 --- a/base_external_dbsource/base_external_dbsource.py +++ b/base_external_dbsource/base_external_dbsource.py @@ -21,12 +21,17 @@ import os import logging + +import psycopg2 + from openerp.osv import orm, fields from openerp.tools.translate import _ import openerp.tools as tools + + _logger = logging.getLogger(__name__) +CONNECTORS = [('postgresql', 'PostgreSQL')] -CONNECTORS = [] try: import sqlalchemy @@ -62,9 +67,6 @@ except: _logger.info('Oracle libraries not available. Please install "cx_Oracle"\ python package.') -import psycopg2 -CONNECTORS.append(('postgresql', 'PostgreSQL')) - class base_external_dbsource(orm.Model): _name = "base.external.dbsource" diff --git a/super_calendar/models/super_calendar_configurator.py b/super_calendar/models/super_calendar_configurator.py index 8c116a52b..c8ba9f96d 100644 --- a/super_calendar/models/super_calendar_configurator.py +++ b/super_calendar/models/super_calendar_configurator.py @@ -152,9 +152,9 @@ class SuperCalendarConfigurator(models.Model): # Convert date_start to UTC timezone if it is a date field # in order to be stored in UTC in the database if line.date_start_field_id.ttype == 'date': - tz = timezone(self._context.get('tz') - or self.env.user.tz - or 'UTC') + tz = timezone(self._context.get('tz') or + self.env.user.tz or + 'UTC') local_date_start = tz.localize(date_start) utc_date_start = local_date_start.astimezone(utc) date_start = utc_date_start