[MERGE] forward port branch saas-11 up to 525aa2e
This commit is contained in:
@@ -1317,8 +1317,8 @@ class calendar_event(osv.Model):
|
|||||||
data['rrule_type'] = 'weekly'
|
data['rrule_type'] = 'weekly'
|
||||||
#repeat monthly by nweekday ((weekday, weeknumber), )
|
#repeat monthly by nweekday ((weekday, weeknumber), )
|
||||||
if r._bynweekday:
|
if r._bynweekday:
|
||||||
data['week_list'] = day_list[r._bynweekday[0][0]].upper()
|
data['week_list'] = day_list[list(r._bynweekday)[0][0]].upper()
|
||||||
data['byday'] = str(r._bynweekday[0][1])
|
data['byday'] = str(list(r._bynweekday)[0][1])
|
||||||
data['month_by'] = 'day'
|
data['month_by'] = 'day'
|
||||||
data['rrule_type'] = 'monthly'
|
data['rrule_type'] = 'monthly'
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -306,7 +306,7 @@ class Field(object):
|
|||||||
'args': EMPTY_DICT, # the parameters given to __init__()
|
'args': EMPTY_DICT, # the parameters given to __init__()
|
||||||
'_attrs': EMPTY_DICT, # the field's non-slot attributes
|
'_attrs': EMPTY_DICT, # the field's non-slot attributes
|
||||||
'_module': None, # the field's module name
|
'_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)
|
'automatic': False, # whether the field is automatically created ("magic" field)
|
||||||
'inherited': False, # whether the field is inherited (_inherits)
|
'inherited': False, # whether the field is inherited (_inherits)
|
||||||
@@ -349,7 +349,7 @@ class Field(object):
|
|||||||
kwargs['string'] = string
|
kwargs['string'] = string
|
||||||
args = {key: val for key, val in kwargs.iteritems() if val is not Default}
|
args = {key: val for key, val in kwargs.iteritems() if val is not Default}
|
||||||
self.args = args or EMPTY_DICT
|
self.args = args or EMPTY_DICT
|
||||||
self.setup_full_done = False
|
self._setup_done = None
|
||||||
|
|
||||||
def new(self, **kwargs):
|
def new(self, **kwargs):
|
||||||
""" Return a field of the same type as ``self``, with its own parameters. """
|
""" 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):
|
def setup_base(self, model, name):
|
||||||
""" Base setup: things that do not depend on other models/fields. """
|
""" 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
|
# optimization for regular fields: keep the base setup
|
||||||
self.setup_full_done = False
|
self._setup_done = 'base'
|
||||||
else:
|
else:
|
||||||
# do the base setup from scratch
|
# do the base setup from scratch
|
||||||
self._setup_attrs(model, name)
|
self._setup_attrs(model, name)
|
||||||
if not self.related:
|
if not self.related:
|
||||||
self._setup_regular_base(model)
|
self._setup_regular_base(model)
|
||||||
|
self._setup_done = 'base'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup field parameter attributes
|
# Setup field parameter attributes
|
||||||
@@ -499,12 +500,12 @@ class Field(object):
|
|||||||
|
|
||||||
def setup_full(self, model):
|
def setup_full(self, model):
|
||||||
""" Full setup: everything else, except recomputation triggers. """
|
""" Full setup: everything else, except recomputation triggers. """
|
||||||
if not self.setup_full_done:
|
if self._setup_done != 'full':
|
||||||
if not self.related:
|
if not self.related:
|
||||||
self._setup_regular_full(model)
|
self._setup_regular_full(model)
|
||||||
else:
|
else:
|
||||||
self._setup_related_full(model)
|
self._setup_related_full(model)
|
||||||
self.setup_full_done = True
|
self._setup_done = 'full'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Setup of non-related fields
|
# Setup of non-related fields
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class configmanager(object):
|
|||||||
group.add_option("--addons-path", dest="addons_path",
|
group.add_option("--addons-path", dest="addons_path",
|
||||||
help="specify additional addons paths (separated by commas).",
|
help="specify additional addons paths (separated by commas).",
|
||||||
action="callback", callback=self._check_addons_path, nargs=1, type="string")
|
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(),
|
group.add_option("-D", "--data-dir", dest="data_dir", my_default=_get_default_datadir(),
|
||||||
help="Directory where to store Odoo data")
|
help="Directory where to store Odoo data")
|
||||||
@@ -361,6 +361,9 @@ class configmanager(object):
|
|||||||
# the same for the pidfile
|
# the same for the pidfile
|
||||||
if self.options['pidfile'] in ('None', 'False'):
|
if self.options['pidfile'] in ('None', 'False'):
|
||||||
self.options['pidfile'] = 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
|
# if defined dont take the configfile value even if the defined value is None
|
||||||
keys = ['xmlrpc_interface', 'xmlrpc_port', 'longpolling_port',
|
keys = ['xmlrpc_interface', 'xmlrpc_port', 'longpolling_port',
|
||||||
@@ -449,20 +452,13 @@ class configmanager(object):
|
|||||||
if len(self.options['language']) > 5:
|
if len(self.options['language']) > 5:
|
||||||
raise Exception('ERROR: The Lang name must take max 5 chars, Eg: -lfr_BE')
|
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:
|
if opt.save:
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
openerp.conf.addons_paths = self.options['addons_path'].split(',')
|
openerp.conf.addons_paths = self.options['addons_path'].split(',')
|
||||||
|
|
||||||
openerp.conf.server_wide_modules = [
|
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):
|
def _is_addons_path(self, path):
|
||||||
|
|||||||
Reference in New Issue
Block a user