OdooWiki OCA HUB

Partner Merge User Consolidation

base_partner_merge_user_consolidation folder_open OCA/partner-contact open_in_new
Base License: AGPL-3

This module extends the standard Merge Contacts wizard in Odoo (base.partner.merge.automatic.wizard) so that user accounts are also consolidated when you merge duplicate contacts. Odoo allows you to merge two (or more) contacts into one. This is great for deduplication.

However, when both of those contacts are linked to different users (res.users), Odoo does not merge or clean up those users. After the merge you can end up with:

  • Multiple logins pointing at the same final contact.
  • Confusing access rights: which login should this person actually use?
  • Compliance issues: inactive/old accounts still exist and could still log in.

This module fixes that:

When you merge contacts and Odoo finishes the normal merge:

  • If the resulting contact has 0 or 1 linked users:
  • Nothing extra happens.
  • If the resulting contact has 2+ linked users:
  • The module chooses one user account to keep:
  • The account with the most recent login date (field login_date, which reflects the last res.users.log record).
  • If nobody has ever logged in, it falls back to the most recently created user.
  • That "kept" user is:
  • Forced to stay active.
  • Explicitly linked to the surviving contact partner.
  • All other users are archived:
  • They are set inactive.
  • Their login is scrambled to a unique value like __merged_user__oldlogin so they can no longer authenticate and so their old login can be reassigned if desired.
  • Security groups are merged:
  • Any groups on the archived users are added to the kept user.
  • Odoo's standard res.users write() logic will automatically:
  • add all implied groups,
  • normalize mutually exclusive role groups,
  • enforce "internal vs portal vs public" constraints.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

When you merge duplicate contacts, this module automatically consolidates their linked user accounts: it keeps one login, archives the others, and combines their access rights.

Odoo's standard Merge Contacts wizard refuses to merge contacts when more than one user account is linked to them. This module removes that obstacle by cleaning up the extra user accounts before the merge happens.

When you merge two or more contacts that have several linked users, the module:

  • Chooses one user account to keep, based on the most recent login or creation date.
  • Adds all access groups from the other users to the kept user, so no permissions are lost.
  • Deactivates the other user accounts and changes their login names so they can no longer sign in.
  • Links the kept user to the final merged contact.

If the contacts have zero or one linked user, nothing extra happens and the merge works as usual.

This behaviour is triggered from the standard Merge Contacts wizard (base.partner.merge.automatic.wizard) in the Contacts app. It touches the contact model (res.partner) and the user model (res.users). No new menus or screens are added; the change is automatic during the merge process.

Depends on

base

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 2 confirmed, 7 with no information of 9 versions.

Sources · Odoo 16.0

Confirmed on 2026-11-03 in branch 16.0 of OCA/partner-contact.

terminal Installation and usage

No verified information

Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.