diff --git a/event_registration_cancel_reason/README.rst b/event_registration_cancel_reason/README.rst new file mode 100644 index 000000000..0f90a7f0f --- /dev/null +++ b/event_registration_cancel_reason/README.rst @@ -0,0 +1,112 @@ +============================================= +Reasons for event registrations cancellations +============================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:aa0b2bc49e4fe64ba84e586b034dd1fa413b17d6e47dd0caa928d80c995be6dd + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/16.0/event_registration_cancel_reason + :alt: OCA/event +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/event-16-0/event-16-0-event_registration_cancel_reason + :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/event&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to add predefined reasons for the attendees to report back +why they cancel their registration to an event. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To configure this module, you need to: + +#. Go to **Events > Configuration > Registrations cancellation reasons** for setting the possible reasons you want to handle. + +You can also set if a reason +is only available for certain types of events or if you leave it empty, for +all. + +Usage +===== + +#. Go to **Events > Events** +#. Enter into the details of any of the events. +#. Press the button "Attendees", located at the top right hand corner. +#. Press the red button in the right part of any of the registrations. +#. A new screen will appear asking you to enter the reason why the registration is cancelled. + +You will get also the same screen: + +#. Go to **Events > Reporting > Attendees (view list)**. +#. Enter into the details of any of the attendees. +#. Press the button *Cancel registration*. + +On this object, you can group by the cancellation reason in the list, calendar or graph view. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `__: + + * Rafael Blasco + * Pedro M. Baeza + * Vicent Cubells + * Cristina Martín + * Victor M.M. Torres + * Víctor Martínez + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/event_registration_cancel_reason/__init__.py b/event_registration_cancel_reason/__init__.py new file mode 100644 index 000000000..66907c702 --- /dev/null +++ b/event_registration_cancel_reason/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import models +from . import wizard diff --git a/event_registration_cancel_reason/__manifest__.py b/event_registration_cancel_reason/__manifest__.py new file mode 100644 index 000000000..2c2de1579 --- /dev/null +++ b/event_registration_cancel_reason/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2016 Antiun Ingeniería S.L. +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2018 Tecnativa - Cristina Martin +# Copyright 2020 Tecnativa - Víctor Martínez +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + "name": "Reasons for event registrations cancellations", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Tecnativa, " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/event", + "category": "Marketing", + "depends": ["event"], + "data": [ + "security/ir.model.access.csv", + "views/event_registration_view.xml", + "wizard/event_registration_cancel_log_reason_view.xml", + ], + "installable": True, +} diff --git a/event_registration_cancel_reason/i18n/es.po b/event_registration_cancel_reason/i18n/es.po new file mode 100644 index 000000000..e8784b4cd --- /dev/null +++ b/event_registration_cancel_reason/i18n/es.po @@ -0,0 +1,141 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * event_registration_cancel_reason +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-15 16:33+0100\n" +"PO-Revision-Date: 2023-10-29 23:37+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.event_registration_cancel_log_reason_view +msgid "Cancel registration" +msgstr "Cancelar registro" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration__cancel_reason_id +msgid "Cancellation Reason" +msgstr "Motivo de cancelación" + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.view_registration_search +msgid "Cancellation reason" +msgstr "Razón de cancelación" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__create_uid +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__create_date +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__create_date +msgid "Created on" +msgstr "Creado en" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__display_name +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration +msgid "Event Registration" +msgstr "Registro evento" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration_cancel_log_reason +msgid "Event Registration Cancel Log Reason" +msgstr "Motivo de Cancelación del Registro del Evento" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration_cancel_reason +msgid "Event Registration Cancel Reason" +msgstr "Motivos de cancelación de registro en evento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__event_type_id +msgid "Event type" +msgstr "Tipo de evento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__event_type_ids +msgid "Event types" +msgstr "Tipos de evento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__id +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__id +msgid "ID" +msgstr "ID" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason____last_update +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__write_uid +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__write_uid +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__write_date +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__write_date +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__reason_id +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__name +msgid "Reason" +msgstr "Razón" + +#. module: event_registration_cancel_reason +#: model:ir.actions.act_window,name:event_registration_cancel_reason.event_registration_cancel_reason_action +#: model:ir.ui.menu,name:event_registration_cancel_reason.menu_event_registration_cancel_reason +msgid "Registration cancellation reasons" +msgstr "Razones de cancelación de registros" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,help:event_registration_cancel_reason.field_event_registration_cancel_reason__event_type_ids +msgid "" +"Select the event types where you want to use this cancellation reason. Leave " +"it empty for using in all." +msgstr "" +"Seleccione los tipos de evento en los que quiere usar esta razón de " +"cancelación. Déjelo en blanco para usarla en todos." + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.event_registration_cancel_log_reason_view +msgid "Select the reason for cancelling the registration:" +msgstr "Seleccione la razón para cancelar el registro:" + +#. module: event_registration_cancel_reason +#: code:addons/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason.py:0 +#, python-format +msgid "You cannot cancel registrations from events of different types at once." +msgstr "No puede cancelar registros de eventos de distintos tipos a la vez." + +#~ msgid "Abort" +#~ msgstr "Abortar" + +#~ msgid "Reason id" +#~ msgstr "Razón" + +#~ msgid "or" +#~ msgstr "o" diff --git a/event_registration_cancel_reason/i18n/event_registration_cancel_reason.pot b/event_registration_cancel_reason/i18n/event_registration_cancel_reason.pot new file mode 100644 index 000000000..1990860d1 --- /dev/null +++ b/event_registration_cancel_reason/i18n/event_registration_cancel_reason.pot @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * event_registration_cancel_reason +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.event_registration_cancel_log_reason_view +msgid "Cancel registration" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration__cancel_reason_id +msgid "Cancellation Reason" +msgstr "" + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.view_registration_search +msgid "Cancellation reason" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__create_uid +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__create_uid +msgid "Created by" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__create_date +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__create_date +msgid "Created on" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__display_name +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__display_name +msgid "Display Name" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration +msgid "Event Registration" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration_cancel_log_reason +msgid "Event Registration Cancel Log Reason" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration_cancel_reason +msgid "Event Registration Cancel Reason" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__event_type_id +msgid "Event type" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__event_type_ids +msgid "Event types" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__id +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__id +msgid "ID" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason____last_update +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason____last_update +msgid "Last Modified on" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__write_uid +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__write_date +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__write_date +msgid "Last Updated on" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__reason_id +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__name +msgid "Reason" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.actions.act_window,name:event_registration_cancel_reason.event_registration_cancel_reason_action +#: model:ir.ui.menu,name:event_registration_cancel_reason.menu_event_registration_cancel_reason +msgid "Registration cancellation reasons" +msgstr "" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,help:event_registration_cancel_reason.field_event_registration_cancel_reason__event_type_ids +msgid "" +"Select the event types where you want to use this cancellation reason. Leave" +" it empty for using in all." +msgstr "" + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.event_registration_cancel_log_reason_view +msgid "Select the reason for cancelling the registration:" +msgstr "" + +#. module: event_registration_cancel_reason +#: code:addons/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason.py:0 +#, python-format +msgid "" +"You cannot cancel registrations from events of different types at once." +msgstr "" diff --git a/event_registration_cancel_reason/i18n/it.po b/event_registration_cancel_reason/i18n/it.po new file mode 100644 index 000000000..9359f6245 --- /dev/null +++ b/event_registration_cancel_reason/i18n/it.po @@ -0,0 +1,133 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * event_registration_cancel_reason +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-19 11:09+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.event_registration_cancel_log_reason_view +msgid "Cancel registration" +msgstr "Annulla registrazione" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration__cancel_reason_id +msgid "Cancellation Reason" +msgstr "Motivo annullamento" + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.view_registration_search +msgid "Cancellation reason" +msgstr "Motivo annullamento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__create_uid +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__create_uid +msgid "Created by" +msgstr "Creato da" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__create_date +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__create_date +msgid "Created on" +msgstr "Creato il" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__display_name +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration +msgid "Event Registration" +msgstr "Registrazione evento" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration_cancel_log_reason +msgid "Event Registration Cancel Log Reason" +msgstr "Registro motivo annullamento registrazione evento" + +#. module: event_registration_cancel_reason +#: model:ir.model,name:event_registration_cancel_reason.model_event_registration_cancel_reason +msgid "Event Registration Cancel Reason" +msgstr "Motivo annullamento registrazione evento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__event_type_id +msgid "Event type" +msgstr "Tipo evento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__event_type_ids +msgid "Event types" +msgstr "Tipi evento" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__id +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__id +msgid "ID" +msgstr "ID" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason____last_update +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__write_uid +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__write_uid +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__write_date +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__write_date +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_log_reason__reason_id +#: model:ir.model.fields,field_description:event_registration_cancel_reason.field_event_registration_cancel_reason__name +msgid "Reason" +msgstr "Motivo" + +#. module: event_registration_cancel_reason +#: model:ir.actions.act_window,name:event_registration_cancel_reason.event_registration_cancel_reason_action +#: model:ir.ui.menu,name:event_registration_cancel_reason.menu_event_registration_cancel_reason +msgid "Registration cancellation reasons" +msgstr "Motivi annullamento registrazione" + +#. module: event_registration_cancel_reason +#: model:ir.model.fields,help:event_registration_cancel_reason.field_event_registration_cancel_reason__event_type_ids +msgid "" +"Select the event types where you want to use this cancellation reason. Leave " +"it empty for using in all." +msgstr "" +"Selezionare i tipi evento dove utilizzare questa causale annullamento. " +"Lasciare vuoto per usarla in tutti." + +#. module: event_registration_cancel_reason +#: model_terms:ir.ui.view,arch_db:event_registration_cancel_reason.event_registration_cancel_log_reason_view +msgid "Select the reason for cancelling the registration:" +msgstr "Selezionare la causale per l'annullamento registrazione:" + +#. module: event_registration_cancel_reason +#: code:addons/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason.py:0 +#, python-format +msgid "You cannot cancel registrations from events of different types at once." +msgstr "" +"Non si possono annullare contemporaneamente registrazioni per eventi di tipo " +"diverso." diff --git a/event_registration_cancel_reason/models/__init__.py b/event_registration_cancel_reason/models/__init__.py new file mode 100644 index 000000000..15bae91df --- /dev/null +++ b/event_registration_cancel_reason/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import event_registration diff --git a/event_registration_cancel_reason/models/event_registration.py b/event_registration_cancel_reason/models/event_registration.py new file mode 100644 index 000000000..5df77d043 --- /dev/null +++ b/event_registration_cancel_reason/models/event_registration.py @@ -0,0 +1,48 @@ +# Copyright 2016 Antiun Ingeniería S.L. +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2018 Tecnativa - Cristina Martin +# Copyright 2020 Tecnativa - Víctor Martínez +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import fields, models + + +class EventRegistration(models.Model): + _inherit = "event.registration" + + cancel_reason_id = fields.Many2one( + comodel_name="event.registration.cancel.reason", + readonly=True, + string="Cancellation Reason", + ondelete="restrict", + ) + + def action_cancel(self): + if self.env.context.get("bypass_reason"): + return super().action_cancel() + return { + "type": "ir.actions.act_window", + "name": "Cancellation reason", + "res_model": "event.registration.cancel.log.reason", + "view_mode": "form", + "target": "new", + } + + def action_set_draft(self): + result = super().action_set_draft() + self.write({"cancel_reason_id": False}) + return result + + +class EventRegistrationCancelReason(models.Model): + _name = "event.registration.cancel.reason" + _description = "Event Registration Cancel Reason" + + name = fields.Char(string="Reason", required=True, translate=True) + event_type_ids = fields.Many2many( + comodel_name="event.type", + string="Event types", + help="Select the event types where you want to use this cancellation " + "reason. Leave it empty for using in all.", + ) diff --git a/event_registration_cancel_reason/readme/CONFIGURE.rst b/event_registration_cancel_reason/readme/CONFIGURE.rst new file mode 100644 index 000000000..e5d40d273 --- /dev/null +++ b/event_registration_cancel_reason/readme/CONFIGURE.rst @@ -0,0 +1,7 @@ +To configure this module, you need to: + +#. Go to **Events > Configuration > Registrations cancellation reasons** for setting the possible reasons you want to handle. + +You can also set if a reason +is only available for certain types of events or if you leave it empty, for +all. diff --git a/event_registration_cancel_reason/readme/CONTRIBUTORS.rst b/event_registration_cancel_reason/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..4cfb25576 --- /dev/null +++ b/event_registration_cancel_reason/readme/CONTRIBUTORS.rst @@ -0,0 +1,8 @@ +* `Tecnativa `__: + + * Rafael Blasco + * Pedro M. Baeza + * Vicent Cubells + * Cristina Martín + * Victor M.M. Torres + * Víctor Martínez diff --git a/event_registration_cancel_reason/readme/DESCRIPTION.rst b/event_registration_cancel_reason/readme/DESCRIPTION.rst new file mode 100644 index 000000000..4d8b4a6fb --- /dev/null +++ b/event_registration_cancel_reason/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows to add predefined reasons for the attendees to report back +why they cancel their registration to an event. diff --git a/event_registration_cancel_reason/readme/USAGE.rst b/event_registration_cancel_reason/readme/USAGE.rst new file mode 100644 index 000000000..0064b1ea8 --- /dev/null +++ b/event_registration_cancel_reason/readme/USAGE.rst @@ -0,0 +1,13 @@ +#. Go to **Events > Events** +#. Enter into the details of any of the events. +#. Press the button "Attendees", located at the top right hand corner. +#. Press the red button in the right part of any of the registrations. +#. A new screen will appear asking you to enter the reason why the registration is cancelled. + +You will get also the same screen: + +#. Go to **Events > Reporting > Attendees (view list)**. +#. Enter into the details of any of the attendees. +#. Press the button *Cancel registration*. + +On this object, you can group by the cancellation reason in the list, calendar or graph view. diff --git a/event_registration_cancel_reason/security/ir.model.access.csv b/event_registration_cancel_reason/security/ir.model.access.csv new file mode 100644 index 000000000..7b181e03b --- /dev/null +++ b/event_registration_cancel_reason/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_event_registration_cancel_reason,event.registration.cancel.reason,model_event_registration_cancel_reason,event.group_event_user,1,1,1,1 +access_event_registration_cancel_log_reason,access_event_registration_cancel_log_reason,model_event_registration_cancel_log_reason,event.group_event_user,1,1,1,1 diff --git a/event_registration_cancel_reason/static/description/icon.png b/event_registration_cancel_reason/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/event_registration_cancel_reason/static/description/icon.png differ diff --git a/event_registration_cancel_reason/static/description/index.html b/event_registration_cancel_reason/static/description/index.html new file mode 100644 index 000000000..5e00613eb --- /dev/null +++ b/event_registration_cancel_reason/static/description/index.html @@ -0,0 +1,461 @@ + + + + + +Reasons for event registrations cancellations + + + +
+

Reasons for event registrations cancellations

+ + +

Beta License: AGPL-3 OCA/event Translate me on Weblate Try me on Runboat

+

This module allows to add predefined reasons for the attendees to report back +why they cancel their registration to an event.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to:

+
    +
  1. Go to Events > Configuration > Registrations cancellation reasons for setting the possible reasons you want to handle.
  2. +
+

You can also set if a reason +is only available for certain types of events or if you leave it empty, for +all.

+
+
+

Usage

+
    +
  1. Go to Events > Events
  2. +
  3. Enter into the details of any of the events.
  4. +
  5. Press the button “Attendees”, located at the top right hand corner.
  6. +
  7. Press the red button in the right part of any of the registrations.
  8. +
  9. A new screen will appear asking you to enter the reason why the registration is cancelled.
  10. +
+

You will get also the same screen:

+
    +
  1. Go to Events > Reporting > Attendees (view list).
  2. +
  3. Enter into the details of any of the attendees.
  4. +
  5. Press the button Cancel registration.
  6. +
+

On this object, you can group by the cancellation reason in the list, calendar or graph view.

+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Rafael Blasco
    • +
    • Pedro M. Baeza
    • +
    • Vicent Cubells
    • +
    • Cristina Martín
    • +
    • Victor M.M. Torres
    • +
    • Víctor Martínez
    • +
    +
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/event_registration_cancel_reason/tests/__init__.py b/event_registration_cancel_reason/tests/__init__.py new file mode 100644 index 000000000..8c9710b83 --- /dev/null +++ b/event_registration_cancel_reason/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_event_registration_cancel_reason diff --git a/event_registration_cancel_reason/tests/test_event_registration_cancel_reason.py b/event_registration_cancel_reason/tests/test_event_registration_cancel_reason.py new file mode 100644 index 000000000..a71d49aa3 --- /dev/null +++ b/event_registration_cancel_reason/tests/test_event_registration_cancel_reason.py @@ -0,0 +1,60 @@ +# Copyright 2016 Antiun Ingeniería S.L. +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import exceptions, fields +from odoo.tests import common + + +class TestEventRegistrationCancelReason(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.event1 = cls.env["event.event"].create( + { + "name": "Test event", + "event_type_id": cls.env.ref("event.event_type_1").id, + "date_begin": fields.Date.today(), + "date_end": fields.Date.today(), + } + ) + cls.event2 = cls.event1.copy() + cls.partner = cls.env["res.partner"].create({"name": "Test partner"}) + cls.cancel_reason = cls.env["event.registration.cancel.reason"].create( + {"name": "Test reason"} + ) + cls.registration1 = cls.env["event.registration"].create( + {"event_id": cls.event1.id, "partner_id": cls.partner.id} + ) + cls.registration2 = cls.registration1.copy() + cls.registration2.event_id = cls.event2 + cls.registrations = cls.registration1 | cls.registration2 + cls.wizard_model = cls.env["event.registration.cancel.log.reason"] + + def test_cancel(self): + action = self.registration1.action_cancel() + self.assertEqual(action.get("type"), "ir.actions.act_window") + wizard = self.wizard_model.with_context( + active_ids=self.registrations.ids + ).create({"reason_id": self.cancel_reason.id}) + wizard.button_log() + self.assertEqual(self.registration1.cancel_reason_id, self.cancel_reason) + self.registration1.action_set_draft() + self.assertFalse(self.registration1.cancel_reason_id) + + def test_cancel_multi_event_type(self): + """Registration cancel from different event types are aborted.""" + self.event2.event_type_id = self.env.ref("event.event_type_2") + with self.assertRaises(exceptions.ValidationError): + self.wizard_model.with_context(active_ids=self.registrations.ids).create( + {"reason_id": self.cancel_reason.id} + ) + + def test_cancel_one_event_without_type(self): + """Registration cancel from 2 events (1 typed, 1 not) are aborted.""" + self.event2.event_type_id = False + with self.assertRaises(exceptions.ValidationError): + self.wizard_model.with_context(active_ids=self.registrations.ids).create( + {"reason_id": self.cancel_reason.id} + ) diff --git a/event_registration_cancel_reason/views/event_registration_view.xml b/event_registration_cancel_reason/views/event_registration_view.xml new file mode 100644 index 000000000..cad1b326e --- /dev/null +++ b/event_registration_cancel_reason/views/event_registration_view.xml @@ -0,0 +1,55 @@ + + + + Event registration form (with cancellation reason) + event.registration + + + + + + + + + + + Event registration search (with cancellation reason) + event.registration + + + + + + + + + Registrations cancellation reasons tree + event.registration.cancel.reason + + + + + + + + + Registration cancellation reasons + event.registration.cancel.reason + tree + + + diff --git a/event_registration_cancel_reason/wizard/__init__.py b/event_registration_cancel_reason/wizard/__init__.py new file mode 100644 index 000000000..c424c3384 --- /dev/null +++ b/event_registration_cancel_reason/wizard/__init__.py @@ -0,0 +1,8 @@ +# Copyright 2016 Antiun Ingeniería S.L. +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2018 Tecnativa - Cristina Martin +# Copyright 2020 Tecnativa - Víctor Martínez +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import event_registration_cancel_log_reason diff --git a/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason.py b/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason.py new file mode 100644 index 000000000..eca7324c5 --- /dev/null +++ b/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason.py @@ -0,0 +1,46 @@ +# Copyright 2016 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# Copyright 2020 Tecnativa - Víctor Martínez +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from odoo import _, api, exceptions, fields, models + + +class EventRegistrationCancelLogReason(models.TransientModel): + _name = "event.registration.cancel.log.reason" + _description = "Event Registration Cancel Log Reason" + + event_type_id = fields.Many2one(comodel_name="event.type", string="Event type") + reason_id = fields.Many2one( + comodel_name="event.registration.cancel.reason", + required=True, + domain="['|', " + " ('event_type_ids', '=', False), " + " ('event_type_ids', '=', event_type_id)]", + ) + + @api.model + def default_get(self, var_fields): + res = super(EventRegistrationCancelLogReason, self).default_get(var_fields) + registrations = self.env["event.registration"].browse( + self.env.context["active_ids"] + ) + first_type = registrations[:1].event_id.event_type_id + for event in registrations.mapped("event_id"): + if event.event_type_id != first_type: + raise exceptions.ValidationError( + _( + "You cannot cancel registrations from events of " + "different types at once." + ) + ) + res["event_type_id"] = first_type.id + return res + + def button_log(self): + self.ensure_one() + registrations = self.env["event.registration"].browse( + self.env.context["active_ids"] + ) + registrations.write({"cancel_reason_id": self.reason_id.id}) + registrations.with_context(bypass_reason=True).action_cancel() diff --git a/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason_view.xml b/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason_view.xml new file mode 100644 index 000000000..4626f7506 --- /dev/null +++ b/event_registration_cancel_reason/wizard/event_registration_cancel_log_reason_view.xml @@ -0,0 +1,25 @@ + + + + Logging registration cancellation wizard + event.registration.cancel.log.reason + +
+ + + + + + + +
+
+
+
diff --git a/setup/event_registration_cancel_reason/odoo/addons/event_registration_cancel_reason b/setup/event_registration_cancel_reason/odoo/addons/event_registration_cancel_reason new file mode 120000 index 000000000..5c6e69771 --- /dev/null +++ b/setup/event_registration_cancel_reason/odoo/addons/event_registration_cancel_reason @@ -0,0 +1 @@ +../../../../event_registration_cancel_reason \ No newline at end of file diff --git a/setup/event_registration_cancel_reason/setup.py b/setup/event_registration_cancel_reason/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/event_registration_cancel_reason/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)