diff --git a/users_ldap_populate/__init__.py b/users_ldap_populate/__init__.py index 302a346ae3..a723c78651 100644 --- a/users_ldap_populate/__init__.py +++ b/users_ldap_populate/__init__.py @@ -2,3 +2,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). from . import models +from . import wizards diff --git a/users_ldap_populate/__manifest__.py b/users_ldap_populate/__manifest__.py index 0dda27d6a5..a62e04c5a2 100644 --- a/users_ldap_populate/__manifest__.py +++ b/users_ldap_populate/__manifest__.py @@ -1,9 +1,10 @@ # Copyright 2012-2018 Therp BV . # Copyright 2021 Tecnativa - João Marques +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). { "name": "LDAP Populate", - "version": "14.0.1.0.0", + "version": "16.0.1.0.0", "author": "Therp BV, Odoo Community Association (OCA)", "maintainers": ["joao-p-marques"], "website": "https://github.com/OCA/server-auth", @@ -13,8 +14,8 @@ "external_dependencies": {"python": ["python-ldap"]}, "data": [ "security/ir.model.access.csv", + "wizards/populate_wizard.xml", "views/users_ldap.xml", - "views/populate_wizard.xml", ], "installable": True, } diff --git a/users_ldap_populate/models/__init__.py b/users_ldap_populate/models/__init__.py index f116612608..cf23628684 100644 --- a/users_ldap_populate/models/__init__.py +++ b/users_ldap_populate/models/__init__.py @@ -1,5 +1,5 @@ # Copyright 2012 Therp BV () +# Copyright 2023 Tecnativa - Carolina Fernandez # License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). from . import users_ldap -from . import populate_wizard diff --git a/users_ldap_populate/models/users_ldap.py b/users_ldap_populate/models/users_ldap.py index c60ab4627e..ea775702f5 100644 --- a/users_ldap_populate/models/users_ldap.py +++ b/users_ldap_populate/models/users_ldap.py @@ -71,7 +71,7 @@ def action_populate(self): user_id = self.with_context( no_reset_password=True )._get_or_create_user(conf, login, result) - except AccessDenied: + except AccessDenied as e: # this happens if the user exists but is active = False # -> fetch the user again and reactivate it self.env.cr.execute( @@ -85,7 +85,7 @@ def action_populate(self): ) user_id = res[0] else: - raise UserError( + raise UserError from e( _("Unable to process user with login %s") % login ) finally: diff --git a/users_ldap_populate/readme/CONTRIBUTORS.rst b/users_ldap_populate/readme/CONTRIBUTORS.rst index ea5370a9c1..79da089a22 100644 --- a/users_ldap_populate/readme/CONTRIBUTORS.rst +++ b/users_ldap_populate/readme/CONTRIBUTORS.rst @@ -4,3 +4,4 @@ * Alexandre Díaz * João Marques * Carlos Roca + * Carolina Fernandez diff --git a/users_ldap_populate/static/description/index.html b/users_ldap_populate/static/description/index.html index 5c9eabe8f7..64db592fce 100644 --- a/users_ldap_populate/static/description/index.html +++ b/users_ldap_populate/static/description/index.html @@ -427,6 +427,7 @@

Contributors

  • Alexandre Díaz
  • João Marques
  • Carlos Roca
  • +
  • Carolina Fernandez
  • diff --git a/users_ldap_populate/wizards/__init__.py b/users_ldap_populate/wizards/__init__.py new file mode 100644 index 0000000000..14fb1be2b6 --- /dev/null +++ b/users_ldap_populate/wizards/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html). + +from . import populate_wizard diff --git a/users_ldap_populate/models/populate_wizard.py b/users_ldap_populate/wizards/populate_wizard.py similarity index 96% rename from users_ldap_populate/models/populate_wizard.py rename to users_ldap_populate/wizards/populate_wizard.py index 4b26815adb..442b63b81a 100644 --- a/users_ldap_populate/models/populate_wizard.py +++ b/users_ldap_populate/wizards/populate_wizard.py @@ -8,7 +8,7 @@ class CompanyLDAPPopulateWizard(models.TransientModel): _name = "res.company.ldap.populate_wizard" _description = "Populate users from LDAP" - name = fields.Char("Name", size=16) + name = fields.Char(size=16) ldap_id = fields.Many2one("res.company.ldap", "LDAP Configuration") users_created = fields.Integer("Number of users created", readonly=True) users_deactivated = fields.Integer("Number of users deactivated", readonly=True) diff --git a/users_ldap_populate/views/populate_wizard.xml b/users_ldap_populate/wizards/populate_wizard.xml similarity index 100% rename from users_ldap_populate/views/populate_wizard.xml rename to users_ldap_populate/wizards/populate_wizard.xml