[MERGE] forward port branch saas-11 up to 525aa2e

This commit is contained in:
Christophe Simonis
2016-10-28 17:01:39 +02:00
3 changed files with 14 additions and 17 deletions
+2 -2
View File
@@ -1317,8 +1317,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'
+7 -6
View File
@@ -306,7 +306,7 @@ class Field(object):
'args': EMPTY_DICT, # the parameters given to __init__()
'_attrs': EMPTY_DICT, # the field's non-slot attributes
'_module': None, # the field's module name
'setup_full_done': False, # whether the field has been fully setup
'_setup_done': None, # the field's setup state: None, 'base' or 'full'
'automatic': False, # whether the field is automatically created ("magic" field)
'inherited': False, # whether the field is inherited (_inherits)
@@ -349,7 +349,7 @@ class Field(object):
kwargs['string'] = string
args = {key: val for key, val in kwargs.iteritems() if val is not Default}
self.args = args or EMPTY_DICT
self.setup_full_done = False
self._setup_done = None
def new(self, **kwargs):
""" Return a field of the same type as ``self``, with its own parameters. """
@@ -401,14 +401,15 @@ class Field(object):
def setup_base(self, model, name):
""" Base setup: things that do not depend on other models/fields. """
if self.setup_full_done and not self.related:
if self._setup_done and not self.related:
# optimization for regular fields: keep the base setup
self.setup_full_done = False
self._setup_done = 'base'
else:
# do the base setup from scratch
self._setup_attrs(model, name)
if not self.related:
self._setup_regular_base(model)
self._setup_done = 'base'
#
# Setup field parameter attributes
@@ -499,12 +500,12 @@ class Field(object):
def setup_full(self, model):
""" Full setup: everything else, except recomputation triggers. """
if not self.setup_full_done:
if self._setup_done != 'full':
if not self.related:
self._setup_regular_full(model)
else:
self._setup_related_full(model)
self.setup_full_done = True
self._setup_done = 'full'
#
# Setup of non-related fields
+5 -9
View File
@@ -111,7 +111,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")
@@ -361,6 +361,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',
@@ -449,20 +452,13 @@ class configmanager(object):
if len(self.options['language']) > 5:
raise Exception('ERROR: The Lang name must take max 5 chars, Eg: -lfr_BE')
# 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 _is_addons_path(self, path):