From 9f09c625f5163ef98ee308ea1bd7cb2004ef1f03 Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Fri, 28 Oct 2016 10:48:01 +0200 Subject: [PATCH 1/2] [FIX] calendar: rule._bynweekday can be a set Depending on the version of dateutil, rule._bynweekday can either be a tuple or a set (see https://github.com/dateutil/dateutil/pull/54), which, in the case of a set, breaks the access by index (see related issue: https://github.com/dateutil/dateutil/issues/24). By casting it into a list, we make sure that we can access [0] in both case. Credits to jke ; closes opw-690761. --- addons/calendar/calendar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index 0c38539d677..3e714243641 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -1343,8 +1343,8 @@ class calendar_event(osv.Model): data['rrule_type'] = 'weekly' #repeat monthly by nweekday ((weekday, weeknumber), ) if r._bynweekday: - data['week_list'] = day_list[r._bynweekday[0][0]].upper() - data['byday'] = str(r._bynweekday[0][1]) + data['week_list'] = day_list[list(r._bynweekday)[0][0]].upper() + data['byday'] = str(list(r._bynweekday)[0][1]) data['month_by'] = 'day' data['rrule_type'] = 'monthly' From c39ca45c6de4124d5301c7bcfbdc286a1d7d934d Mon Sep 17 00:00:00 2001 From: Wolfgang Taferner Date: Fri, 28 Oct 2016 13:41:11 +0200 Subject: [PATCH 2/2] [FIX] config: avoid to accept server-wide-modules with None as a module Fixes #14048 Fixes #14045 Closes #14051 --- openerp/tools/config.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/openerp/tools/config.py b/openerp/tools/config.py index 70b70900b60..f1dd6251036 100644 --- a/openerp/tools/config.py +++ b/openerp/tools/config.py @@ -142,7 +142,7 @@ class configmanager(object): group.add_option("--addons-path", dest="addons_path", help="specify additional addons paths (separated by commas).", action="callback", callback=self._check_addons_path, nargs=1, type="string") - group.add_option("--load", dest="server_wide_modules", help="Comma-separated list of server-wide modules. Default is 'web,web_kanban'") + group.add_option("--load", dest="server_wide_modules", help="Comma-separated list of server-wide modules.", my_default='web,web_kanban') group.add_option("-D", "--data-dir", dest="data_dir", my_default=_get_default_datadir(), help="Directory where to store Odoo data") @@ -408,6 +408,9 @@ class configmanager(object): # the same for the pidfile if self.options['pidfile'] in ('None', 'False'): self.options['pidfile'] = False + # and the server_wide_modules + if self.options['server_wide_modules'] in ('', 'None', 'False'): + self.options['server_wide_modules'] = 'web,web_kanban' # if defined dont take the configfile value even if the defined value is None keys = ['xmlrpc_interface', 'xmlrpc_port', 'longpolling_port', @@ -530,20 +533,13 @@ class configmanager(object): #if self.options['db_host']: # self._generate_pgpassfile() - # server_wide_modules defaults to web,web_kanban if empty or unset - server_wide_modules = self.options['server_wide_modules'] = ( - self.options['server_wide_modules'] - if self.options['server_wide_modules'] - else 'web,web_kanban' - ) - if opt.save: self.save() openerp.conf.addons_paths = self.options['addons_path'].split(',') openerp.conf.server_wide_modules = [ - m.strip() for m in server_wide_modules.split(',') + m.strip() for m in self.options['server_wide_modules'].split(',') if m.strip() ] def _generate_pgpassfile(self):