diff --git a/fetchmail_attach_from_folder/model/fetchmail_server.py b/fetchmail_attach_from_folder/model/fetchmail_server.py index bc6c5443d..4fb0e0649 100644 --- a/fetchmail_attach_from_folder/model/fetchmail_server.py +++ b/fetchmail_attach_from_folder/model/fetchmail_server.py @@ -44,7 +44,7 @@ class fetchmail_server(Model): def __init__(self, pool, cr): self._columns['object_id'].required = False - return super(fetchmail_server, self).__init__(pool, cr) + super(fetchmail_server, self).__init__(pool, cr) def onchange_server_type( self, cr, uid, ids, server_type=False, ssl=False, diff --git a/mail_environment/env_mail.py b/mail_environment/env_mail.py index 944e5ca88..9b9b8f2b7 100644 --- a/mail_environment/env_mail.py +++ b/mail_environment/env_mail.py @@ -140,7 +140,9 @@ class FetchmailServer(osv.osv): res[fetchmail.id] = config_vals return res - def _type_search(self, cr, uid, obj, name, args, context={}): + def _type_search(self, cr, uid, obj, name, args, context=None): + if context is None: + context = self.pool['res.users'].context_get(cr, uid) result_ids = [] # read all incomming servers values all_ids = self.search(cr, uid, [], context=context) diff --git a/server_environment/serv_config.py b/server_environment/serv_config.py index ccac4f007..eb5be0509 100644 --- a/server_environment/serv_config.py +++ b/server_environment/serv_config.py @@ -53,8 +53,10 @@ if not os.path.exists(ck_path): ) -def setboolean(obj, attr, _bool=_boolean_states): +def setboolean(obj, attr, _bool=None): """Replace the attribute with a boolean.""" + if _bool is None: + _bool = dict(_boolean_states) # we copy original dict res = _bool[getattr(obj, attr).lower()] setattr(obj, attr, res) return res