[ADD]partner_create_internal_user

This commit is contained in:
2026-07-01 16:57:56 +02:00
parent c8d6b8f6c4
commit 4d739af30a
8 changed files with 816 additions and 0 deletions

View File

@@ -0,0 +1,107 @@
============================
Partner Create Internal User
============================
This module adds a **Grant internal user access** action on contacts
(``res.partner``), mirroring the standard *Grant portal access* wizard
provided by the ``portal`` module, but creating an **internal user**
(``base.group_user``) instead of a portal user.
**Table of contents**
.. contents::
:local:
Features
========
Grant Internal User Access
--------------------------
A new server action *Grant internal user access* is available from the
contact list and form views (in the *Action* menu). It opens a wizard listing
the selected contacts (and their child contacts), where you can, for each line:
* **Grant Access**: create (or reuse) a user, make it an internal user and
send the standard "set your password" invitation email.
* **Revoke Access**: archive the internal user.
* **Re-Invite**: send the invitation email again.
Email Validation
----------------
For each contact, the email address is validated and the wizard detects
whether the email is already used by another user, preventing duplicates.
Invalid or already-registered emails block the access grant.
How It Works
============
The wizard is built on top of the same logic as the standard ``portal.wizard``:
1. **Create**: when the contact has no user yet, a user is created from the
default user template (the ``base.template_portal_user_id`` system
parameter), in the same company as the contact.
2. **Promote**: the user is added to the internal users group
(``base.group_user``) and removed from the portal/public groups, so a
contact previously linked to a portal user is upgraded to internal.
3. **Invite**: an invitation email is sent using the standard
``auth_signup.set_password_email`` template (via ``action_reset_password``
with the ``create_user`` context), letting the user define their password.
Dependencies
============
This module depends on:
* ``auth_signup``: provides the user creation from template, the signup token
mechanism and the "set password" invitation email.
Installation
============
Use the standard Odoo module installation procedure to install
``partner_create_internal_user``.
Usage
=====
1. Open a contact (or select several contacts in the list view).
2. Use *Action > Grant internal user access*.
3. Fix the email addresses if needed, then click *Grant Access*.
Configuration
=============
Creating internal users is restricted to users belonging to the
*Administration / Access Rights* group (``base.group_erp_manager``).
The new users are created from the template user configured through the
``base.template_portal_user_id`` system parameter and then moved to the
internal users group.
Bug Tracker
===========
Bugs are tracked on `Elabore Git Issues <https://git.elabore.coop/Elabore/partner-tools/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smash it by providing a detailed and welcomed
feedback.
Credits
=======
Authors
-------
* `Elabore <https://elabore.coop>`_
Maintainer
----------
.. image:: https://elabore.coop/logo.png
:alt: Elabore
:target: https://elabore.coop
This module is maintained by Elabore.