Skip to content

Commit

Permalink
[ADD] website_event_attendee_signup
Browse files Browse the repository at this point in the history
Co-authored-By: Ivan Yelizariev <[email protected]>
Co-authored-By: Artem Rafailov <[email protected]>
Co-authored-By: Eugene Molotov <[email protected]>
Co-authored-By: Victor Bykov <[email protected]>
  • Loading branch information
5 people committed Oct 25, 2024
1 parent af844d7 commit ef5a8d9
Show file tree
Hide file tree
Showing 22 changed files with 475 additions and 0 deletions.
107 changes: 107 additions & 0 deletions website_event_attendee_signup/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
========================
Auto Sign Up Event guest
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:ee8a36cdc3d6f01ada622878d60a5ac3e171ad22a1a0dc5181539a91b812f3d3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/licence-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-it--projects--llc%2Fwebsite--addons-lightgray.png?logo=github
:target: https://github.com/it-projects-llc/website-addons/tree/14.0/website_event_attendee_signup
:alt: it-projects-llc/website-addons

|badge1| |badge2| |badge3|

The modules creates ``res.user`` from every ``event.registration``
(*attendee*) and calls ``signup_prepare()`` method to allow to send an
email with signup url to access the portal.

The modules adds email template ``Event: Signup``, which can be used
directly or as an example to modify other email template.

**Table of contents**

.. contents::
:local:

Configuration
=============

- At ``Events`` menu create or select existing event

- Switch **[x] Signup attendees to portal** on

- Switch **[x] Create Partners in registration** on

- At ``Email Schedule`` add a line:

- **Email to Send**: *Event: Signup*
- **Unit**: *Immediately*
- **When to Run**: *After each registration*

Alternative email template configuration:

- Activate Developer Mode
- Open menu ``[[ Settings ]] >> Technical >> Email >> Templates``
- Filter out records by keyword *Event*
- Open *Event: Signup* record
- Click ``[Edit]``
- Click icon ``</>`` to switch to Code view
- Copy the code related to signup
- Go back to templates
- Open *Event: Reminder* record
- Click ``[Edit]``
- Click icon ``</>`` to switch to Code view
- Paste the copied code
- Click ``[Save]``

Usage
=====

- Register few attendees to the Event via Website (``/event`` page)
- Confirm the registrations (e.g. via backend)
- RESULT: every attendees receives email with a link to signup to
portal

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

Bugs are tracked on `GitHub Issues <https://github.com/it-projects-llc/website-addons/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/it-projects-llc/website-addons/issues/new?body=module:%20website_event_attendee_signup%0Aversion:%2014.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
-------

* IT-Projects LLC

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

- Ivan Yelizariev (https://github.com/yelizariev)
- Artem Rafailov (https://github.com/Ommo73)
- Eugene Molotov (https://github.com/em230418)
- Victor Bykov (https://github.com/BykovVik)

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

This module is part of the `it-projects-llc/website-addons <https://github.com/it-projects-llc/website-addons/tree/14.0/website_event_attendee_signup>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions website_event_attendee_signup/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions website_event_attendee_signup/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Auto Sign Up Event guest",
"summary": "Attendees can use portal dashboard to make extra purchases for the event, for example.", # noqa: E501
"category": "Marketing",
"images": ["images/banner.jpg"],
"version": "14.0.1.0.0",
"author": "IT-Projects LLC",
"support": "[email protected]",
"website": "https://github.com/it-projects-llc/website-addons",
"license": "AGPL-3",
"depends": ["partner_event"],
"data": ["views/event_event_views.xml", "data/mail_template_data.xml"],
"qweb": [],
"demo": [],
}
35 changes: 35 additions & 0 deletions website_event_attendee_signup/data/mail_template_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="email_template_signup" model="mail.template">
<field name="name">Event: Signup</field>
<!--<field name="email_from">${(object.partner_id.email or '')|safe}</field>-->
<field name="subject">Welcome to our Portal!</field>
<field name="partner_to">${object.attendee_partner_id.id}</field>
<field name="model_id" ref="event.model_event_registration" />
<field name="auto_delete" eval="True" />
<field name="lang">${object.attendee_partner_id.lang}</field>
<field
name="body_html"
><![CDATA[
<p>
Hello ${object.attendee_partner_id.name},<br />
You was registered as attendee of ${object.event_id.name}.
% if object.attendee_partner_id.signup_token:
Use the link below to sing-up on portal to access your event dashboard:
<div style="padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777">
<div style="text-align: center; margin-top: 16px;">
<a href="${object.attendee_partner_id.signup_url}" style="padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px">Accept invitation to portal</a>
</div>
</div>
% endif
</p>
<p>
</p>
<p>Best regards,</p>
]]></field>
</record>
</odoo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_event_attendee_signup
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_event_attendee_signup
#: model:mail.template,body_html:website_event_attendee_signup.email_template_signup
msgid "\n"
" \n"
" <p>\n"
" Hello ${object.attendee_partner_id.name},<br />\n"
"\n"
" You was registered as attendee of ${object.event_id.name}.\n"
"\n"
" % if object.attendee_partner_id.signup_token:\n"
" Use the link below to sing-up on portal to access your event dashboard:\n"
" <div style=\"padding:0px;width:600px;margin:auto;background: #FFFFFF repeat top /100%;color:#777777\">\n"
" <div style=\"text-align: center; margin-top: 16px;\">\n"
" <a href=\"${object.attendee_partner_id.signup_url}\" style=\"padding: 5px 10px; font-size: 12px; line-height: 18px; color: #FFFFFF; border-color:#875A7B; text-decoration: none; display: inline-block; margin-bottom: 0px; font-weight: 400; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; background-image: none; background-color: #875A7B; border: 1px solid #875A7B; border-radius:3px\">Accept invitation to portal</a>\n"
" </div>\n"
" </div>\n"
" % endif\n"
" </p>\n"
" <p>\n"
" </p>\n"
" <p>Best regards,</p>\n"
" \n"
" "
msgstr ""

#. module: website_event_attendee_signup
#: model:ir.model,name:website_event_attendee_signup.model_event_registration
msgid "Attendee"
msgstr ""

#. module: website_event_attendee_signup
#: model:ir.model,name:website_event_attendee_signup.model_event_event
msgid "Event"
msgstr ""

#. module: website_event_attendee_signup
#: model:ir.model.fields,help:website_event_attendee_signup.field_event_event_attendee_signup
msgid "Every attendee receives email to confirm email and set password to access to portal"
msgstr ""

#. module: website_event_attendee_signup
#: model:ir.model.fields,field_description:website_event_attendee_signup.field_event_event_attendee_signup
msgid "Signup attendees to portal"
msgstr ""

#. module: website_event_attendee_signup
#: model:mail.template,subject:website_event_attendee_signup.email_template_signup
msgid "Welcome to our Portal!"
msgstr ""

Binary file added website_event_attendee_signup/images/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions website_event_attendee_signup/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import event_event
from . import event_registration
11 changes: 11 additions & 0 deletions website_event_attendee_signup/models/event_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class EventEvent(models.Model):
_inherit = "event.event"

attendee_signup = fields.Boolean(
string="Signup attendees to portal",
help="Every attendee receives email to confirm email and set password to access to portal", # noqa: E501
default=False,
)
24 changes: 24 additions & 0 deletions website_event_attendee_signup/models/event_registration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from odoo import api, models


class EventRegistration(models.Model):
_inherit = "event.registration"

@api.model
def create(self, vals):
res = super(EventRegistration, self).create(vals)

if res.event_id.attendee_signup and res.attendee_partner_id:
login = res.attendee_partner_id.email
user = self.env["res.users"].search([("login", "=ilike", login)])
if not user:
user = (
self.env["res.users"]
.sudo()
._signup_create_user(
{"login": login, "partner_id": res.attendee_partner_id.id}
)
)
user.partner_id.signup_prepare()

return res
3 changes: 3 additions & 0 deletions website_event_attendee_signup/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
24 changes: 24 additions & 0 deletions website_event_attendee_signup/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
* At `Events` menu create or select existing event
* Switch **[x] Signup attendees to portal** on
* Switch **[x] Create Partners in registration** on
* At `Email Schedule` add a line:

- **Email to Send**: *Event: Signup*
- **Unit**: *Immediately*
- **When to Run**: *After each registration*

Alternative email template configuration:

* Activate Developer Mode
* Open menu `[[ Settings ]] >> Technical >> Email >> Templates`
* Filter out records by keyword *Event*
* Open *Event: Signup* record
* Click `[Edit]`
* Click icon `</>` to switch to Code view
* Copy the code related to signup
* Go back to templates
* Open *Event: Reminder* record
* Click `[Edit]`
* Click icon `</>` to switch to Code view
* Paste the copied code
* Click `[Save]`
4 changes: 4 additions & 0 deletions website_event_attendee_signup/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Ivan Yelizariev (https://github.com/yelizariev)
- Artem Rafailov (https://github.com/Ommo73)
- Eugene Molotov (https://github.com/em230418)
- Victor Bykov (https://github.com/BykovVik)
4 changes: 4 additions & 0 deletions website_event_attendee_signup/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The modules creates `res.user` from every `event.registration` (*attendee*)
and calls `signup_prepare()` method to allow to send an email with signup url to access the portal.

The modules adds email template `Event: Signup`, which can be used directly or as an example to modify other email template.
3 changes: 3 additions & 0 deletions website_event_attendee_signup/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Register few attendees to the Event via Website (`/event` page)
* Confirm the registrations (e.g. via backend)
* RESULT: every attendees receives email with a link to signup to portal
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ef5a8d9

Please sign in to comment.