From 5c137c1a008028409365a86d0539541be3c2df8a Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Wed, 8 Oct 2014 11:35:50 +0200 Subject: [PATCH] Use cr argument instead of cursor, propagate context --- mail_environment/__init__.py | 1 + mail_environment/env_mail.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mail_environment/__init__.py b/mail_environment/__init__.py index be0b4da9a..89dd1478f 100644 --- a/mail_environment/__init__.py +++ b/mail_environment/__init__.py @@ -1 +1,2 @@ +# -*- coding: utf-8 -*- from . import env_mail diff --git a/mail_environment/env_mail.py b/mail_environment/env_mail.py index 88c8a15bd..d16f1963a 100644 --- a/mail_environment/env_mail.py +++ b/mail_environment/env_mail.py @@ -27,12 +27,12 @@ from openerp.addons.server_environment import serv_config class IrMail(orm.Model): _inherit = "ir.mail_server" - def _get_smtp_conf(self, cursor, uid, ids, name, args, context=None): + def _get_smtp_conf(self, cr, uid, ids, name, args, context=None): """ Return configuration """ res = {} - for mail_server in self.browse(cursor, uid, ids): + for mail_server in self.browse(cr, uid, ids, context=context): global_section_name = 'outgoing_mail' # default vals @@ -99,12 +99,12 @@ class FetchmailServer(orm.Model): """Incoming POP/IMAP mail server account""" _inherit = 'fetchmail.server' - def _get_incom_conf(self, cursor, uid, ids, name, args, context=None): + def _get_incom_conf(self, cr, uid, ids, name, args, context=None): """ Return configuration """ res = {} - for fetchmail in self.browse(cursor, uid, ids): + for fetchmail in self.browse(cr, uid, ids, context=context): global_section_name = 'incoming_mail' key_types = {'port': int, @@ -132,7 +132,7 @@ class FetchmailServer(orm.Model): 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): result_ids = [] # read all incomming servers values all_ids = self.search(cr, uid, [], context=context)