From d05d498577c162662fd2bed61b6ae0c7738321af Mon Sep 17 00:00:00 2001 From: Rodney Vargas Date: Wed, 13 Apr 2016 09:37:12 -0600 Subject: [PATCH 1/2] [ADD]-auth_admin_passkey: migrate from API8 to API9 --- auth_admin_passkey/__init__.py | 23 +++------------- auth_admin_passkey/__openerp__.py | 27 ++++--------------- .../data/ir_config_parameter.xml | 19 ++----------- auth_admin_passkey/model/__init__.py | 23 +++------------- auth_admin_passkey/model/res_config.py | 23 +++------------- auth_admin_passkey/model/res_users.py | 24 +++-------------- auth_admin_passkey/tests/__init__.py | 23 +++------------- .../tests/test_auth_admin_passkey.py | 23 +++------------- auth_admin_passkey/view/res_config_view.xml | 21 +++------------ 9 files changed, 28 insertions(+), 178 deletions(-) diff --git a/auth_admin_passkey/__init__.py b/auth_admin_passkey/__init__.py index 088e71f640c..09c7e7d6d7b 100644 --- a/auth_admin_passkey/__init__.py +++ b/auth_admin_passkey/__init__.py @@ -1,23 +1,6 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from . import model diff --git a/auth_admin_passkey/__openerp__.py b/auth_admin_passkey/__openerp__.py index 69b7c8b1cd6..86e2ea9864d 100644 --- a/auth_admin_passkey/__openerp__.py +++ b/auth_admin_passkey/__openerp__.py @@ -1,28 +1,11 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## { 'name': 'Authentification - Admin Passkey', - 'version': '8.0.2.1.1', + 'version': '9.0.0.1', 'category': 'base', 'author': "GRAP,Odoo Community Association (OCA)", 'website': 'http://www.grap.coop', @@ -41,6 +24,6 @@ 'images': [], 'post_load': '', 'application': False, - 'installable': False, + 'installable': True, 'auto_install': False, } diff --git a/auth_admin_passkey/data/ir_config_parameter.xml b/auth_admin_passkey/data/ir_config_parameter.xml index 7c7f3625d53..cc8c4de529a 100644 --- a/auth_admin_passkey/data/ir_config_parameter.xml +++ b/auth_admin_passkey/data/ir_config_parameter.xml @@ -1,22 +1,7 @@ - - - - + - - - - - - - - - - - - - diff --git a/auth_admin_passkey/model/__init__.py b/auth_admin_passkey/model/__init__.py index 60c3790aabd..1a2f0492da2 100644 --- a/auth_admin_passkey/model/__init__.py +++ b/auth_admin_passkey/model/__init__.py @@ -1,24 +1,7 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from . import res_config from . import res_users diff --git a/auth_admin_passkey/model/res_config.py b/auth_admin_passkey/model/res_config.py index 11c7fa083d9..6356c4b67e1 100644 --- a/auth_admin_passkey/model/res_config.py +++ b/auth_admin_passkey/model/res_config.py @@ -1,24 +1,7 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from openerp.osv import fields from openerp.osv.orm import TransientModel diff --git a/auth_admin_passkey/model/res_users.py b/auth_admin_passkey/model/res_users.py index d0a5a8aa260..291a17a8df3 100644 --- a/auth_admin_passkey/model/res_users.py +++ b/auth_admin_passkey/model/res_users.py @@ -1,24 +1,7 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import datetime @@ -35,7 +18,6 @@ class res_users(Model): # Private Function section def _get_translation(self, cr, lang, text): - context = {'lang': lang} # noqa: _() checks page for locals return _(text) def _send_email_passkey(self, cr, user_id, user_agent_env): diff --git a/auth_admin_passkey/tests/__init__.py b/auth_admin_passkey/tests/__init__.py index 8150785b1a4..ea1396e75d2 100644 --- a/auth_admin_passkey/tests/__init__.py +++ b/auth_admin_passkey/tests/__init__.py @@ -1,23 +1,6 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## from . import test_auth_admin_passkey diff --git a/auth_admin_passkey/tests/test_auth_admin_passkey.py b/auth_admin_passkey/tests/test_auth_admin_passkey.py index 2ce02d26c50..1374b3abb2f 100644 --- a/auth_admin_passkey/tests/test_auth_admin_passkey.py +++ b/auth_admin_passkey/tests/test_auth_admin_passkey.py @@ -1,24 +1,7 @@ +# -*- coding: utf-8 -*- +# © 2016 GRAP +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # -*- encoding: utf-8 -*- -############################################################################## -# -# Admin Passkey module for OpenERP -# Copyright (C) 2013-2014 GRAP (http://www.grap.coop) -# @author Sylvain LE GAL (https://twitter.com/legalsylvain) -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## import threading diff --git a/auth_admin_passkey/view/res_config_view.xml b/auth_admin_passkey/view/res_config_view.xml index 9907297051d..0bcf3eb3774 100644 --- a/auth_admin_passkey/view/res_config_view.xml +++ b/auth_admin_passkey/view/res_config_view.xml @@ -1,22 +1,7 @@ - - - - + - - - - - - - - - - - - - @@ -25,7 +10,7 @@ base.config.settings - +