Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[portal_invitation_by_website](portal_invitation_by_website/) | 19.0.1.0.0 | | Restrict portal users to a specific website from the invitation wizard
[website_conditional_visibility_user_group](website_conditional_visibility_user_group/) | 19.0.1.0.0 | | Only internal users will see the blocks you add this condition to
[website_cookiefirst](website_cookiefirst/) | 19.0.1.0.0 | | Cookiefirst integration
[website_form_require_legal](website_form_require_legal/) | 19.0.1.0.1 | | Add possibility to require confirm legal terms.
Expand Down
107 changes: 107 additions & 0 deletions portal_invitation_by_website/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============================
Portal Invitation by Website
============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0488fede852ebdbfad8cb4b98611ee4ba6ecf76e22cc28bd88c4e1614111ff3e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/19.0/portal_invitation_by_website
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-19-0/website-19-0-portal_invitation_by_website
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends the portal invitation wizard to allow restricting
portal users to a specific website in multi-website environments.

When inviting contacts as portal users from the backend, you can now
select a website at the wizard level (applied to all contacts) or
override it per-contact. The invitation email URL will automatically use
the selected website's domain, ensuring the signup link directs the user
to the correct site.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Go to **Contacts** and select one or more contacts.
2. Open the action menu and click **Grant Portal Access**.
3. In the wizard, select a **Website** to restrict access to that site.

- The website applies to all contacts in the list.
- You can override the website per contact using the **Website**
column.

4. Click **Grant Access** for each contact or use the batch action.

The invitation email will contain a signup URL pointing to the selected
website's domain. If the website has **Specific User Accounts** enabled
(``Website > Configuration > Settings``), the portal user will only be
able to log in from that website.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/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 <https://github.com/OCA/website/issues/new?body=module:%20portal_invitation_by_website%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Cristina Hidalgo

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/website <https://github.com/OCA/website/tree/19.0/portal_invitation_by_website>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions portal_invitation_by_website/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
15 changes: 15 additions & 0 deletions portal_invitation_by_website/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Portal Invitation by Website",
"summary": "Restrict portal users to a specific website from the invitation wizard",
"version": "19.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/website",
"license": "AGPL-3",
"category": "Website",
"depends": ["portal", "website"],
"data": [
"data/mail_template_portal_welcome.xml",
"views/portal_wizard_views.xml",
],
"installable": True,
}
209 changes: 209 additions & 0 deletions portal_invitation_by_website/data/mail_template_portal_welcome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="mail_template_portal_welcome_website" model="mail.template">
<field name="name">Portal: User Invite (Website)</field>
<field name="model_id" ref="base.model_res_users" />
<field
name="email_from"
>{{ (object.company_id.email_formatted or user.email_formatted) }}</field>
<field name="email_to">{{ object.email_formatted }}</field>
<field
name="description"
>Invitation email using website name instead of company name</field>
<field name="lang">{{ object.lang }}</field>
<field name="auto_delete" eval="True" />
<field
name="subject"
>Your account at {{ object.website_id.name or object.company_id.name }}</field>
<field name="body_html" type="html">
<table
border="0"
cellpadding="0"
cellspacing="0"
style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"
>
<tr>
<td align="center">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;"
>
<tbody>
<!-- HEADER -->
<tr>
<td align="center" style="min-width: 590px;">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
>
<tr>
<td valign="middle">
<span
style="font-size: 10px;"
>Your Account</span>
<br />
<span
style="font-size: 20px; font-weight: bold;"
t-out="object.name or ''"
>Marc Demo</span>
</td>
<td
valign="middle"
align="right"
t-if="not object.company_id.uses_default_logo"
>
<img
t-attf-src="/logo.png?company={{ object.company_id.id }}"
style="padding: 0px; margin: 0px; height: auto; width: 80px;"
t-att-alt="object.company_id.name"
/>
</td>
</tr>
<tr>
<td
colspan="2"
style="text-align:center;"
>
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin:16px 0px 16px 0px;"
/>
</td>
</tr>
</table>
</td>
</tr>
<!-- CONTENT -->
<tr>
<td align="center" style="min-width: 590px;">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;"
>
<tr>
<td
valign="top"
style="font-size: 13px;"
>
<div>
Dear <t t-out="object.name or ''">Marc Demo</t>,<br /> <br />
Welcome to <t
t-out="object.website_id.name or object.company_id.name or ''"
>YourCompany</t>'s Portal!<br /><br
/>
An account has been created for you with the following login: <t
t-out="object.login"
>demo</t><br /><br />
Click on the button below to pick a password and activate your account.
<div style="margin: 16px 0px 16px 0px; text-align: center;">
<a
t-att-href="object.partner_id._get_signup_url()"
t-attf-style="display: inline-block; padding: 10px; text-decoration: none; font-size: 12px; background-color: {{object.company_id.email_secondary_color or '#875A7B'}}; color: {{object.company_id.email_primary_color or '#FFFFFF'}}; border-radius: 5px;"
>
<strong
>Activate Account</strong>
</a>
</div>
<t
t-out="ctx.get('welcome_message') or ''"
>Welcome to our company's portal.</t>
</div>
</td>
</tr>
<tr>
<td style="text-align:center;">
<hr
width="100%"
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"
/>
</td>
</tr>
</table>
</td>
</tr>
<!-- FOOTER -->
<tr>
<td align="center" style="min-width: 590px;">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;"
>
<tr>
<td valign="middle" align="left">
<t
t-out="object.website_id.name or object.company_id.name or ''"
>YourCompany</t>
</td>
</tr>
<tr>
<td
valign="middle"
align="left"
style="opacity: 0.7;"
>
<t
t-out="object.company_id.phone or ''"
>+1 650-123-4567</t>
<t t-if="object.company_id.email">
| <a
t-attf-href="mailto:{{ object.company_id.email }}"
style="text-decoration:none; color: #454748;"
t-out="object.company_id.email or ''"
>info@yourcompany.com</a>
</t>
<t
t-if="object.website_id.domain or object.company_id.website"
>
| <a
t-att-href="object.website_id.domain or object.company_id.website"
style="text-decoration:none; color: #454748;"
t-out="object.website_id.domain or object.company_id.website"
>http://www.example.com</a>
</t>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<!-- POWERED BY -->
<tr>
<td align="center" style="min-width: 590px;">
<table
border="0"
cellpadding="0"
cellspacing="0"
width="590"
style="min-width: 590px; background-color: #F1F1F1; color: #454748; padding: 8px; border-collapse:separate;"
>
<tr>
<td style="text-align: center; font-size: 13px;">
Powered by <a
target="_blank"
t-attf-href="https://www.odoo.com?utm_source=db&amp;utm_medium={{ ctx.get('medium', 'auth') }}"
t-attf-style="color: {{object.company_id.email_secondary_color or '#875A7B'}};"
>Odoo</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</field>
</record>
</odoo>
Loading