After merging contacts, automatically consolidate their linked user accounts.
Project description
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_<id>_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.
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
Contributors
Nikos Tsirintanis <ntsirintanis@therp.nl>
Maintainers
This module is maintained by the OCA.
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:
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odoo_addon_base_partner_merge_user_consolidation-16.0.1.0.0.1-py3-none-any.whl.
File metadata
- Download URL: odoo_addon_base_partner_merge_user_consolidation-16.0.1.0.0.1-py3-none-any.whl
- Upload date:
- Size: 28.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c10f448b5bd1eb6d65e57bf75ecba357bdb5160eb67b4b510ffb04defc2cd00f
|
|
| MD5 |
78a952436e87207b1f2652d4cbf35caa
|
|
| BLAKE2b-256 |
cdfbf4a126b49c7d295c0772de9cb6feeb6deb8b98af20860d391e9f51b35d35
|