-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
22 changed files
with
975 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,109 @@ | ||
============================ | ||
Conditional Events Questions | ||
============================ | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:781fdb40ebddd4c1fae529b9e5f350496fba62dc72cc650369c9aea1f7e037fa | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-LGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
:alt: License: LGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fevent-lightgray.png?logo=github | ||
:target: https://github.com/OCA/event/tree/17.0/website_event_questions_by_ticket | ||
:alt: OCA/event | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/event-17-0/event-17-0-website_event_questions_by_ticket | ||
: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=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows to set that an event question is only asked for | ||
certain tickets. | ||
|
||
If the question is general, then having one of the allowed tickets will | ||
serve for showing it. If the question is specific to each attendee, then | ||
the evaluation will be done for each of the tickets. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
1. Go to *Events > Events* | ||
2. Create or select one event. | ||
3. On the "Questions" page, create a new question or edit an existing | ||
one. | ||
4. Fill the field "Limited to tickets" for restricting the question to | ||
that ticket. Leave it blank for making it available for all tickets. | ||
|
||
Usage | ||
===== | ||
|
||
1. Go to the website. | ||
2. Go to "Events" section and select one of them. | ||
3. Select ticket quantity and click on "Register". | ||
4. On the popup dialog, the questions linked to that ticket and those | ||
without restrictions will be shown. | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
- Add tests (tour) to the module. | ||
|
||
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 to smash it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/event/issues/new?body=module:%20website_event_questions_by_ticket%0Aversion:%2017.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>`__: | ||
|
||
- Pedro M. Baeza | ||
- Stefan Ungureanu | ||
- Carolina Fernandez | ||
|
||
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/17.0/website_event_questions_by_ticket>`_ 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,3 @@ | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
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,16 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# Copyright 2023 Tecnativa - Carolina Fernandez | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
{ | ||
"name": "Conditional Events Questions", | ||
"summary": "Events Questions conditional to the chosen ticket", | ||
"version": "17.0.1.0.0", | ||
"category": "Website", | ||
"website": "https://github.com/OCA/event", | ||
"author": "Tecnativa, Odoo Community Association (OCA)", | ||
"license": "LGPL-3", | ||
"installable": True, | ||
"depends": ["website_event"], | ||
"data": ["views/event_event_views.xml", "views/event_templates.xml"], | ||
} |
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,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_questions_by_ticket | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-07-03 12:54+0000\n" | ||
"Last-Translator: André Volksdorf <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: de\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: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_event | ||
msgid "Event" | ||
msgstr "Veranstaltung" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_question | ||
msgid "Event Question" | ||
msgstr "Veranstalltungsfragen" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model_terms:ir.ui.view,arch_db:website_event_questions_by_ticket.view_event_question_form | ||
msgid "Leave it empty for being available for all tickets" | ||
msgstr "Lassen Sie das Feld leer, um für alle Tickets verfügbar zu sein" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
msgstr "Auf Tickets beschränken" |
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,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_questions_by_ticket | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 13.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2021-03-17 14:45+0000\n" | ||
"Last-Translator: Ana Suárez <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: es\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.3.2\n" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_event | ||
msgid "Event" | ||
msgstr "Evento" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_question | ||
msgid "Event Question" | ||
msgstr "Pregunta Evento" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model_terms:ir.ui.view,arch_db:website_event_questions_by_ticket.view_event_question_form | ||
msgid "Leave it empty for being available for all tickets" | ||
msgstr "Dejar vacío para estar disponible para todas las entradas" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
msgstr "Limitado a entradas" |
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,37 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_questions_by_ticket | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2024-07-03 16:47+0000\n" | ||
"Last-Translator: Rémi <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: fr\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: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_event | ||
msgid "Event" | ||
msgstr "Évènement" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_question | ||
msgid "Event Question" | ||
msgstr "Question" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model_terms:ir.ui.view,arch_db:website_event_questions_by_ticket.view_event_question_form | ||
msgid "Leave it empty for being available for all tickets" | ||
msgstr "Laisser vide pour activer sur tous les billets" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
msgstr "Restreindre aux tickets" |
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,46 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_questions_by_ticket | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-07-18 14:11+0000\n" | ||
"Last-Translator: mymage <[email protected]>\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: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_event | ||
msgid "Event" | ||
msgstr "Evento" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_question | ||
msgid "Event Question" | ||
msgstr "Domanda evento" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model_terms:ir.ui.view,arch_db:website_event_questions_by_ticket.view_event_question_form | ||
msgid "Leave it empty for being available for all tickets" | ||
msgstr "Lasciare vuoto per renderlo disponibile per tutti i biglietti" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
msgstr "Limitato ai biglietti" | ||
|
||
#~ msgid "Display Name" | ||
#~ msgstr "Nome visualizzato" | ||
|
||
#~ msgid "ID" | ||
#~ msgstr "ID" | ||
|
||
#~ msgid "Last Modified on" | ||
#~ msgstr "Ultima modifica il" |
34 changes: 34 additions & 0 deletions
34
website_event_questions_by_ticket/i18n/website_event_questions_by_ticket.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,34 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * website_event_questions_by_ticket | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 16.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_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_event | ||
msgid "Event" | ||
msgstr "" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model,name:website_event_questions_by_ticket.model_event_question | ||
msgid "Event Question" | ||
msgstr "" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model_terms:ir.ui.view,arch_db:website_event_questions_by_ticket.view_event_question_form | ||
msgid "Leave it empty for being available for all tickets" | ||
msgstr "" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
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,3 @@ | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from . import event_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,36 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class EventEvent(models.Model): | ||
_inherit = "event.event" | ||
|
||
def _get_specific_questions(self, ticket_id): | ||
self.ensure_one() | ||
return self.specific_question_ids.filtered( | ||
lambda x: ( | ||
not x.restricted_ticket_ids or ticket_id in x.restricted_ticket_ids.ids | ||
) | ||
) | ||
|
||
def _get_general_questions(self, ticket_ids): | ||
self.ensure_one() | ||
return self.general_question_ids.filtered( | ||
lambda x: ( | ||
not x.restricted_ticket_ids | ||
or (set(ticket_ids) & set(x.restricted_ticket_ids.ids)) | ||
) | ||
) | ||
|
||
|
||
class EventQuestion(models.Model): | ||
_inherit = "event.question" | ||
|
||
restricted_ticket_ids = fields.Many2many( | ||
comodel_name="event.event.ticket", | ||
string="Limited to tickets", | ||
domain="[('event_id', '=', parent.id)]", | ||
ondelete="restrict", | ||
) |
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 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
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,6 @@ | ||
1. Go to *Events \> Events* | ||
2. Create or select one event. | ||
3. On the "Questions" page, create a new question or edit an existing | ||
one. | ||
4. Fill the field "Limited to tickets" for restricting the question to | ||
that ticket. Leave it blank for making it available for all tickets. |
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 @@ | ||
- [Tecnativa](https://www.tecnativa.com): | ||
- Pedro M. Baeza | ||
- Stefan Ungureanu | ||
- Carolina Fernandez | ||
- Pilar Vargas |
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,6 @@ | ||
This module allows to set that an event question is only asked for | ||
certain tickets. | ||
|
||
If the question is general, then having one of the allowed tickets will | ||
serve for showing it. If the question is specific to each attendee, then | ||
the evaluation will be done for each of the tickets. |
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 @@ | ||
- Add tests (tour) to the module. |
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 @@ | ||
1. Go to the website. | ||
2. Go to "Events" section and select one of them. | ||
3. Select ticket quantity and click on "Register". | ||
4. On the popup dialog, the questions linked to that ticket and those | ||
without restrictions will be shown. |
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.