Skip to content

Commit

Permalink
[MIG] users_ldap_populate: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinafernandez-tecnativa committed Sep 28, 2023
1 parent 316b5b9 commit 44f46fd
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions users_ldap_populate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).

from . import models
from . import wizards
5 changes: 3 additions & 2 deletions users_ldap_populate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright 2012-2018 Therp BV <https://therp.nl>.
# 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",
Expand All @@ -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,
}
2 changes: 1 addition & 1 deletion users_ldap_populate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2012 Therp BV (<http://therp.nl>)
# 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
4 changes: 2 additions & 2 deletions users_ldap_populate/models/users_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -85,7 +85,7 @@ def action_populate(self):
)
user_id = res[0]
else:
raise UserError(
raise UserError from e(

Check warning on line 88 in users_ldap_populate/models/users_ldap.py

View check run for this annotation

Codecov / codecov/patch

users_ldap_populate/models/users_ldap.py#L88

Added line #L88 was not covered by tests
_("Unable to process user with login %s") % login
)
finally:
Expand Down
1 change: 1 addition & 0 deletions users_ldap_populate/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
* Alexandre Díaz
* João Marques
* Carlos Roca
* Carolina Fernandez
1 change: 1 addition & 0 deletions users_ldap_populate/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Alexandre Díaz</li>
<li>João Marques</li>
<li>Carlos Roca</li>
<li>Carolina Fernandez</li>
</ul>
</li>
</ul>
Expand Down
3 changes: 3 additions & 0 deletions users_ldap_populate/wizards/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/gpl.html).

from . import populate_wizard
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 44f46fd

Please sign in to comment.