diff --git a/website_event_attendee_signup/README.rst b/website_event_attendee_signup/README.rst new file mode 100644 index 0000000..96de35f --- /dev/null +++ b/website_event_attendee_signup/README.rst @@ -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/17.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 `_. +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 +------- + +* 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 `_ project on GitHub. + +You are welcome to contribute. diff --git a/website_event_attendee_signup/__init__.py b/website_event_attendee_signup/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/website_event_attendee_signup/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/website_event_attendee_signup/__manifest__.py b/website_event_attendee_signup/__manifest__.py new file mode 100644 index 0000000..623f59f --- /dev/null +++ b/website_event_attendee_signup/__manifest__.py @@ -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": "17.0.1.0.0", + "author": "IT-Projects LLC", + "support": "it@it-projects.info", + "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": [], +} diff --git a/website_event_attendee_signup/data/mail_template_data.xml b/website_event_attendee_signup/data/mail_template_data.xml new file mode 100644 index 0000000..585fc71 --- /dev/null +++ b/website_event_attendee_signup/data/mail_template_data.xml @@ -0,0 +1,35 @@ + + + + Event: Signup + + Welcome to our Portal! + ${object.attendee_partner_id.id} + + + ${object.attendee_partner_id.lang} + + Hello ${object.attendee_partner_id.name},
+ + 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: + + % endif +

+

+

+

Best regards,

+ + ]]>
+
+
diff --git a/website_event_attendee_signup/i18n/website_event_attendee_signup.pot b/website_event_attendee_signup/i18n/website_event_attendee_signup.pot new file mode 100644 index 0000000..db605ba --- /dev/null +++ b/website_event_attendee_signup/i18n/website_event_attendee_signup.pot @@ -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" +"

\n" +" Hello ${object.attendee_partner_id.name},
\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" +"

\n" +"
\n" +" Accept invitation to portal\n" +"
\n" +"
\n" +" % endif\n" +"

\n" +"

\n" +"

\n" +"

Best regards,

\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 "" + diff --git a/website_event_attendee_signup/images/banner.jpg b/website_event_attendee_signup/images/banner.jpg new file mode 100644 index 0000000..24b12f3 Binary files /dev/null and b/website_event_attendee_signup/images/banner.jpg differ diff --git a/website_event_attendee_signup/models/__init__.py b/website_event_attendee_signup/models/__init__.py new file mode 100644 index 0000000..f2c2a7e --- /dev/null +++ b/website_event_attendee_signup/models/__init__.py @@ -0,0 +1,2 @@ +from . import event_event +from . import event_registration diff --git a/website_event_attendee_signup/models/event_event.py b/website_event_attendee_signup/models/event_event.py new file mode 100644 index 0000000..f7e9d82 --- /dev/null +++ b/website_event_attendee_signup/models/event_event.py @@ -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, + ) diff --git a/website_event_attendee_signup/models/event_registration.py b/website_event_attendee_signup/models/event_registration.py new file mode 100644 index 0000000..8a47950 --- /dev/null +++ b/website_event_attendee_signup/models/event_registration.py @@ -0,0 +1,24 @@ +from odoo import api, models + + +class EventRegistration(models.Model): + _inherit = "event.registration" + + @api.model + def create(self, vals): + res = super().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 diff --git a/website_event_attendee_signup/pyproject.toml b/website_event_attendee_signup/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/website_event_attendee_signup/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/website_event_attendee_signup/readme/CONFIGURE.md b/website_event_attendee_signup/readme/CONFIGURE.md new file mode 100644 index 0000000..1339516 --- /dev/null +++ b/website_event_attendee_signup/readme/CONFIGURE.md @@ -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]` diff --git a/website_event_attendee_signup/readme/CONTRIBUTORS.md b/website_event_attendee_signup/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..2a8fd8d --- /dev/null +++ b/website_event_attendee_signup/readme/CONTRIBUTORS.md @@ -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) diff --git a/website_event_attendee_signup/readme/DESCRIPTION.md b/website_event_attendee_signup/readme/DESCRIPTION.md new file mode 100644 index 0000000..3bd7f56 --- /dev/null +++ b/website_event_attendee_signup/readme/DESCRIPTION.md @@ -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. diff --git a/website_event_attendee_signup/readme/USAGE.md b/website_event_attendee_signup/readme/USAGE.md new file mode 100644 index 0000000..5785d7e --- /dev/null +++ b/website_event_attendee_signup/readme/USAGE.md @@ -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 diff --git a/website_event_attendee_signup/static/description/events-custom-fields-10.png b/website_event_attendee_signup/static/description/events-custom-fields-10.png new file mode 100644 index 0000000..3318fed Binary files /dev/null and b/website_event_attendee_signup/static/description/events-custom-fields-10.png differ diff --git a/website_event_attendee_signup/static/description/events-custom-fields-101.png b/website_event_attendee_signup/static/description/events-custom-fields-101.png new file mode 100644 index 0000000..d56d6b3 Binary files /dev/null and b/website_event_attendee_signup/static/description/events-custom-fields-101.png differ diff --git a/website_event_attendee_signup/static/description/icon.png b/website_event_attendee_signup/static/description/icon.png new file mode 100644 index 0000000..5d32362 Binary files /dev/null and b/website_event_attendee_signup/static/description/icon.png differ diff --git a/website_event_attendee_signup/static/description/index.html b/website_event_attendee_signup/static/description/index.html new file mode 100644 index 0000000..0b4d2ab --- /dev/null +++ b/website_event_attendee_signup/static/description/index.html @@ -0,0 +1,117 @@ +
+
+
+
+

Auto Sign Up Event guest

+

Attendees can use portal dashboard to make extra purchases for the event, for example.

+
+
+ +
+
+
+
+

+ The modules creates User from every Event registration and sends an email with signup url to access the portal. +

+
+
+
+
+ +
+
+

How It Works

+
+ You can install this module in a usual way. After installation, you need to configure the module according to the documentation. +
+
+

+ Register few attendees to the Event via Website +

+
+
+ +
+
+
+ +
+
+

+ Every person will receive the email to continue signup process. +

+
+
+ +
+
+ + +
+
+
+

Want to take a look?

+

For a live demostration click LIVE PREVIEW button above (near to Add to Cart)

+
+
+
+ +
+
+
+

Need our service?

+

Contact us by email or fill out request form

+ +
+
+
+
+ Tested on Odoo
11.0 community +
+ +
+
+
+
+ + + +
+ + diff --git a/website_event_attendee_signup/tests/__init__.py b/website_event_attendee_signup/tests/__init__.py new file mode 100644 index 0000000..aa74bf9 --- /dev/null +++ b/website_event_attendee_signup/tests/__init__.py @@ -0,0 +1 @@ +from . import test_create diff --git a/website_event_attendee_signup/tests/common.py b/website_event_attendee_signup/tests/common.py new file mode 100644 index 0000000..40d4ae7 --- /dev/null +++ b/website_event_attendee_signup/tests/common.py @@ -0,0 +1,22 @@ +from datetime import datetime, timedelta + +from odoo import fields +from odoo.tests.common import TransactionCase + + +class TestCase(TransactionCase): + def setUp(self): + super().setUp() + self.event = self.env["event.event"].create( + { + "name": "TestEvent", + "attendee_signup": True, + "create_partner": True, + "date_begin": fields.Datetime.to_string( + datetime.today() + timedelta(days=1) + ), + "date_end": fields.Datetime.to_string( + datetime.today() + timedelta(days=15) + ), + } + ) diff --git a/website_event_attendee_signup/tests/test_create.py b/website_event_attendee_signup/tests/test_create.py new file mode 100644 index 0000000..5a05a22 --- /dev/null +++ b/website_event_attendee_signup/tests/test_create.py @@ -0,0 +1,24 @@ +from . import common + +USER_DEMO = "base.user_demo" + + +class TestCreate(common.TestCase): + def test_create(self): + """superuser creates registration for other person""" + agent = self.env.user.partner_id + + registration = self.env["event.registration"].create( + { + "partner_id": agent.id, + "event_id": self.event.id, + "name": "Test", + "email": "test@example.com", + } + ) + + self.assertEqual(registration.partner_id.id, agent.id) + self.assertTrue( + registration.attendee_partner_id, "attendee_partner_id was not set" + ) + self.assertNotEqual(registration.attendee_partner_id.id, agent.id) diff --git a/website_event_attendee_signup/views/event_event_views.xml b/website_event_attendee_signup/views/event_event_views.xml new file mode 100644 index 0000000..eaa9003 --- /dev/null +++ b/website_event_attendee_signup/views/event_event_views.xml @@ -0,0 +1,13 @@ + + + + Events (Singup) + event.event + + + + + + + +