From 61cac543715c56238129c2823c3685f6122a2ea1 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 24 Mar 2014 15:10:02 +0100 Subject: [PATCH] [FIX] res_config.py : incorrect call. self.pool('xxx') -> self.pool['xxx'] [REF] res_users.py : same call to self.pool in other res_users class. --- auth_admin_passkey/model/res_config.py | 8 ++++---- auth_admin_passkey/model/res_users.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py index 71c2d1ec7..40caeb348 100644 --- a/auth_admin_passkey/model/res_config.py +++ b/auth_admin_passkey/model/res_config.py @@ -13,7 +13,7 @@ class base_config_settings(TransientModel): ### Getter / Setter Section def get_default_auth_admin_passkey_send_to_admin(self, cr, uid, ids, context=None): - icp = self.pool('ir.config_parameter') + icp = self.pool['ir.config_parameter'] return { 'auth_admin_passkey_send_to_admin' : safe_eval(icp.get_param(cr, uid, 'auth_admin_passkey.send_to_admin', 'True')), @@ -21,13 +21,13 @@ class base_config_settings(TransientModel): def set_auth_admin_passkey_send_to_admin(self, cr, uid, ids, context=None): config = self.browse(cr, uid, ids[0], context=context) - icp = self.pool('ir.config_parameter') + icp = self.pool['ir.config_parameter'] icp.set_param(cr, uid, 'auth_admin_passkey.send_to_admin', repr(config.auth_admin_passkey_send_to_admin)) def get_default_auth_admin_passkey_send_to_user(self, cr, uid, ids, context=None): - icp = self.pool('ir.config_parameter') + icp = self.pool['ir.config_parameter'] return { 'auth_admin_passkey_send_to_user' : safe_eval(icp.get_param(cr, uid, 'auth_admin_passkey.send_to_user', 'True')), @@ -35,7 +35,7 @@ class base_config_settings(TransientModel): def set_auth_admin_passkey_send_to_user(self, cr, uid, ids, context=None): config = self.browse(cr, uid, ids[0], context=context) - icp = self.pool('ir.config_parameter') + icp = self.pool['ir.config_parameter'] icp.set_param(cr, uid, 'auth_admin_passkey.send_to_user', repr(config.auth_admin_passkey_send_to_user)) diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index 58afe4509..72bde57c2 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -24,8 +24,8 @@ class res_users(Model): """ Send a email to the admin of the system and / or the user to inform passkey use """ mails = [] - mail_obj = self.pool.get('mail.mail') - icp_obj = self.pool.get('ir.config_parameter') + mail_obj = self.pool['mail.mail'] + icp_obj = self.pool['ir.config_parameter'] admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) login_user = self.browse(cr, SUPERUSER_ID, user_id) send_to_admin = literal_eval(icp_obj.get_param(cr, SUPERUSER_ID, @@ -55,7 +55,7 @@ class res_users(Model): def _send_email_same_password(self, cr, login_user): """ Send a email to the admin user to inform that another user has the same password as him""" - mail_obj = self.pool.get('mail.mail') + mail_obj = self.pool['mail.mail'] admin_user = self.browse(cr, SUPERUSER_ID, SUPERUSER_ID) if admin_user.email: mail_obj.create(cr, SUPERUSER_ID, {