-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from Change2improve/11.0-mig-website_event_re…
…quire_login [11.0][MIG] website event require login
- Loading branch information
Showing
18 changed files
with
769 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
=========================== | ||
Website Event Require Login | ||
=========================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-OCA%2Fevent-lightgray.png?logo=github | ||
:target: https://github.com/OCA/event/tree/10.0/website_event_require_login | ||
:alt: OCA/event | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/event-11-0/event-10-0-website_event_require_login | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/199/11.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Require login for event registration from the website. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
To configure this module, you need to: | ||
|
||
#. Go to an event and set the Website Require option on. | ||
|
||
Usage | ||
===== | ||
|
||
In the website go to an event that requieres login and try to register being | ||
logged out. | ||
|
||
If the event is set up to require login, a pop up will be shown requiring the | ||
user to do so. | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
* An interesting option could be to be able to hide events to unregistered | ||
users. | ||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/event/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/event/issues/new?body=module:%20website_event_require_login%0Aversion:%2010.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>`_: | ||
* David Vidal | ||
* Rafael Blasco | ||
|
||
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/event <https://github.com/OCA/event/tree/10.0/website_event_require_login>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import controllers | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright 2019 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
'name': 'Website Event Require Login', | ||
'version': '11.0.1.0.0', | ||
'author': 'Tecnativa, ' | ||
'Odoo Community Association (OCA)', | ||
'website': 'https://github.com/OCA/event', | ||
'category': 'Event', | ||
'depends': [ | ||
'website_event', | ||
], | ||
'data': [ | ||
'views/event_views.xml', | ||
'views/website_event_templates.xml', | ||
], | ||
'installable': True, | ||
'license': 'AGPL-3', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2019 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo.http import request, route | ||
from odoo.addons.website_event.controllers.main import WebsiteEventController | ||
|
||
|
||
class RequireLoginToRegister(WebsiteEventController): | ||
|
||
@route() | ||
def registration_new(self, event, **post): | ||
public_user = request.env.user == request.website.user_id | ||
if public_user and event.website_require_login: | ||
return request.env['ir.ui.view'].render_template( | ||
'website_event_require_login' | ||
'.modal_attendees_registration_login_required', { | ||
'event_url': event.website_url, | ||
}) | ||
return super( | ||
RequireLoginToRegister, self).registration_new(event, **post) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_require_login | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2019-03-19 12:00+0000\n" | ||
"PO-Revision-Date: 2019-03-19 12:00+0000\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_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "&times;" | ||
msgstr "&times;" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "Close" | ||
msgstr "Cerrar" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.model,name:website_event_require_login.model_event_event | ||
msgid "Event" | ||
msgstr "Evento" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.model.fields,help:website_event_require_login.field_event_event_website_require_login | ||
msgid "If set, a user must be logged in to be able to register attendees from the website." | ||
msgstr "Si está establecido, el usuario deberá iniciar sesión para registrar asistentes desde el sito web." | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "Login" | ||
msgstr "Iniciar sesión" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "Login required" | ||
msgstr "Inicio de sesión requerido" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.model.fields,field_description:website_event_require_login.field_event_event_website_require_login | ||
msgid "Require login for website registrations" | ||
msgstr "Requerir inicio de sesión para registros desde la página web" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "You must be logged in to be able to register to this event." | ||
msgstr "Debe iniciar sesión para poder regitrase en este evento." | ||
|
55 changes: 55 additions & 0 deletions
55
website_event_require_login/i18n/website_event_require_login.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_require_login | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 10.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_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "&times;" | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "Close" | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.model,name:website_event_require_login.model_event_event | ||
msgid "Event" | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.model.fields,help:website_event_require_login.field_event_event_website_require_login | ||
msgid "If set, a user must be logged in to be able to register attendees from the website." | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "Login" | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "Login required" | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.model.fields,field_description:website_event_require_login.field_event_event_website_require_login | ||
msgid "Require login for website registrations" | ||
msgstr "" | ||
|
||
#. module: website_event_require_login | ||
#: model:ir.ui.view,arch_db:website_event_require_login.modal_attendees_registration_login_required | ||
msgid "You must be logged in to be able to register to this event." | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2019 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo import fields, models | ||
|
||
|
||
class EventEvent(models.Model): | ||
_inherit = 'event.event' | ||
|
||
website_require_login = fields.Boolean( | ||
string='Require login for website registrations', | ||
help='If set, a user must be logged in to be able to register ' | ||
'attendees from the website.', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
To configure this module, you need to: | ||
|
||
#. Go to an event and set the Website Require option on. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
* `Tecnativa <https://www.tecnativa.com>`_: | ||
* David Vidal | ||
* Rafael Blasco |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Require login for event registration from the website. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* An interesting option could be to be able to hide events to unregistered | ||
users. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
In the website go to an event that requieres login and try to register being | ||
logged out. | ||
|
||
If the event is set up to require login, a pop up will be shown requiring the | ||
user to do so. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.