-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
21 changed files
with
937 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/website_event_questions_by_ticket/odoo/addons/website_event_questions_by_ticket
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 @@ | ||
../../../../website_event_questions_by_ticket |
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 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
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,105 @@ | ||
============================ | ||
Conditional Events Questions | ||
============================ | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! 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-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/15.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-15-0/event-15-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/webui/builds.html?repo=OCA/event&target_branch=15.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 | ||
============= | ||
|
||
#. Go to *Events > Events* | ||
#. Create or select one event. | ||
#. On the "Questions" page, create a new question or edit an existing one. | ||
#. Fill the field "Limited to tickets" for restricting the question to that | ||
ticket. Leave it blank for making it available for all tickets. | ||
|
||
Usage | ||
===== | ||
|
||
|
||
#. Go to the website. | ||
#. Go to "Events" section and select one of them. | ||
#. Select ticket quantity and click on "Register". | ||
#. 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 smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/event/issues/new?body=module:%20website_event_questions_by_ticket%0Aversion:%2015.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 | ||
|
||
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/15.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,15 @@ | ||
# Copyright 2019 Tecnativa - Pedro M. Baeza | ||
# 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": "15.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_sale", "website_event_questions"], | ||
"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,56 @@ | ||
# 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 <ana.suarez@qubiq.es>\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.fields,field_description:website_event_questions_by_ticket.field_event_event__display_name | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. 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:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event__id | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event____last_update | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question____last_update | ||
msgid "Last Modified on" | ||
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 "Dejar vacío para estar disponible para todos los tickets" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__restricted_ticket_ids | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question_template_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
msgstr "Limitado a 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,56 @@ | ||
# 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: 2022-10-08 23:35+0000\n" | ||
"Last-Translator: Sergio Zanchetta <primes2h@gmail.com>\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.3.2\n" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event__display_name | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__display_name | ||
msgid "Display Name" | ||
msgstr "Nome visualizzato" | ||
|
||
#. 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:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event__id | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__id | ||
msgid "ID" | ||
msgstr "ID" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event____last_update | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question____last_update | ||
msgid "Last Modified on" | ||
msgstr "Ultima modifica il" | ||
|
||
#. 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 | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question_template_question__restricted_ticket_ids | ||
msgid "Limited to tickets" | ||
msgstr "" |
53 changes: 53 additions & 0 deletions
53
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,53 @@ | ||
# 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" | ||
"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.fields,field_description:website_event_questions_by_ticket.field_event_event__display_name | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. 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:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event__id | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: website_event_questions_by_ticket | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_event____last_update | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question____last_update | ||
msgid "Last Modified on" | ||
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 | ||
#: model:ir.model.fields,field_description:website_event_questions_by_ticket.field_event_question_template_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,5 @@ | ||
#. Go to *Events > Events* | ||
#. Create or select one event. | ||
#. On the "Questions" page, create a new question or edit an existing one. | ||
#. 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,4 @@ | ||
* `Tecnativa <https://www.tecnativa.com>`_: | ||
|
||
* Pedro M. Baeza | ||
* Stefan Ungureanu |
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,6 @@ | ||
|
||
#. Go to the website. | ||
#. Go to "Events" section and select one of them. | ||
#. Select ticket quantity and click on "Register". | ||
#. 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.