Partner Merge User Consolidation

After merging contacts, automatically consolidate their linked user accounts.

Technical Name:
base_partner_merge_user_consolidation
Version:
16.0
License:
Author:
Therp BV
https://odoo-community.org/web/image/product.template/717008/image_1920?unique=7be1587
  • Odoo Version

Read the rules established to regulate the OCA (Bylaws )

Partner Merge User Consolidation

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runboat

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:
    1. 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.
    2. That "kept" user is:
      • Forced to stay active.
      • Explicitly linked to the surviving contact partner.
    3. All other users are archived:
      • They are set inactive.
      • Their login is scrambled to a unique value like __merged_user_<id>_oldlogin so they can no longer authenticate and so their old login can be reassigned if desired.
    4. 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.

Table of contents

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Therp BV

Contributors

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

ntsirintanis

This module is part of the OCA/partner-contact project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

This is a preview of the recently viewed products by the user.
Once the user has seen at least one product this snippet will be visible.

Recently viewed Products