Skip to content

[19.0][MIG] users_ldap_groups: Migration to 19.0 - #1000

Open
dinkotom wants to merge 1 commit into
OCA:19.0from
dinkotom:19.0-mig-users_ldap_groups
Open

[19.0][MIG] users_ldap_groups: Migration to 19.0#1000
dinkotom wants to merge 1 commit into
OCA:19.0from
dinkotom:19.0-mig-users_ldap_groups

Conversation

@dinkotom

@dinkotom dinkotom commented Sep 7, 2026

Copy link
Copy Markdown

Migration of users_ldap_groups to 19.0.

Based on the 18.0 migration in #889 by @cvinh (Invitu) — thanks!

Odoo 19 changes handled:

  • res.users._login is an instance method (no db argument, no separate cursor) — follows the auth_ldap 19.0 implementation
  • res.users.groups_id renamed to group_ids; m2m commands via fields.Command
  • auth_ldap model class CompanyLDAP renamed to ResCompanyLdap (tests)
  • res.users.authenticate() no longer takes the database name (tests); cursor mocking dropped since login runs in the current cursor
  • _()self.env._()

Verified: pre-commit clean (ruff 0.13.0, pylint-odoo mandatory), unit tests pass on a clean odoo:19.0 (0 failed, 0 error(s) of 4 tests).

@OCA-git-bot OCA-git-bot added series:19.0 mod:users_ldap_groups Module users_ldap_groups labels Sep 7, 2026
@dinkotom
dinkotom force-pushed the 19.0-mig-users_ldap_groups branch from ddee7b1 to ba0c3ca Compare September 7, 2026 15:41
- res.users._login is an instance method in Odoo 19 (no db argument,
  no separate cursor) - follow the auth_ldap 19.0 implementation
- res.users.groups_id was renamed to group_ids; use fields.Command
- auth_ldap renamed the model class CompanyLDAP -> ResCompanyLdap (tests)
- res.users.authenticate() no longer takes the database name (tests)
- drop the cursor mocking in tests: login now runs in the current cursor
- drop guards for falsy return values: in Odoo 19 both res.users._login
  and res.company.ldap._get_or_create_user raise AccessDenied instead of
  returning False
- simplify the fake LDAP connection in tests (unused stubs)
- add python-ldap to the repository requirements.txt

Based on the 18.0 migration by Cyril Vinh-Tung (Invitu), OCA#889.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dinkotom
dinkotom force-pushed the 19.0-mig-users_ldap_groups branch from ba0c3ca to 439da22 Compare September 7, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:users_ldap_groups Module users_ldap_groups series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants