diff --git a/addons/website_event_questions/__init__.py b/addons/website_event_questions/__init__.py index 8114cc7a69b..5a31f331a2a 100644 --- a/addons/website_event_questions/__init__.py +++ b/addons/website_event_questions/__init__.py @@ -3,5 +3,4 @@ from . import controllers from . import models -from . import report from . import tests diff --git a/addons/website_event_questions/__manifest__.py b/addons/website_event_questions/__manifest__.py index 099abeef1a7..c0c913a28ee 100644 --- a/addons/website_event_questions/__manifest__.py +++ b/addons/website_event_questions/__manifest__.py @@ -4,12 +4,15 @@ 'name': 'Questions on Events', 'description': 'Questions on Events', 'category': 'Marketing', - 'version': '1.0', + 'version': '1.1', 'depends': ['website_event'], 'data': [ + 'views/assets.xml', 'views/event_views.xml', + 'views/event_registration_answer_views.xml', + 'views/event_registration_views.xml', + 'views/event_question_views.xml', 'views/event_templates.xml', - 'report/report_event_question_view.xml', 'security/ir.model.access.csv', ], 'demo': [ diff --git a/addons/website_event_questions/controllers/main.py b/addons/website_event_questions/controllers/main.py index a24ccc941f9..fdcc1f66313 100644 --- a/addons/website_event_questions/controllers/main.py +++ b/addons/website_event_questions/controllers/main.py @@ -1,28 +1,47 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. +from odoo.http import request + from odoo.addons.website_event.controllers.main import WebsiteEventController class WebsiteEvent(WebsiteEventController): def _process_attendees_form(self, event, form_details): - ''' Process data posted from the attendee details form. ''' + """ Process data posted from the attendee details form. + Extracts question answers: + - For both questions asked 'once_per_order' and questions asked to every attendee + - For questions of type 'simple_choice', extracting the suggested answer id + - For questions of type 'text_box', extracting the text answer of the attendee. """ registrations = super(WebsiteEvent, self)._process_attendees_form(event, form_details) for registration in registrations: - registration['answer_ids'] = [] + registration['registration_answer_ids'] = [] general_answer_ids = [] for key, value in form_details.items(): - if 'answer_ids' in key: - index = int(key.split('-')[0]) - if not index: - general_answer_ids.append([4, int(value)]) - else: - registrations[index-1]['answer_ids'].append([4, int(value)]) + if 'question_answer' in key and value: + dummy, registration_index, question_id = key.split('-') + question = request.env['event.question'].browse(int(question_id)) + answer_values = None + if question.question_type == 'simple_choice': + answer_values = { + 'question_id': int(question_id), + 'value_answer_id': int(value) + } + elif question.question_type == 'text_box': + answer_values = { + 'question_id': int(question_id), + 'value_text_box': value + } + + if answer_values and not int(registration_index): + general_answer_ids.append((0, 0, answer_values)) + elif answer_values: + registrations[int(registration_index) - 1]['registration_answer_ids'].append((0, 0, answer_values)) for registration in registrations: - registration['answer_ids'].extend(general_answer_ids) + registration['registration_answer_ids'].extend(general_answer_ids) return registrations diff --git a/addons/website_event_questions/data/event_question_demo.xml b/addons/website_event_questions/data/event_question_demo.xml index 414ddb44735..021763bd8a3 100644 --- a/addons/website_event_questions/data/event_question_demo.xml +++ b/addons/website_event_questions/data/event_question_demo.xml @@ -6,12 +6,12 @@ - + Yes 1 - + No 2 @@ -20,22 +20,50 @@ Meal Type + simple_choice - + Mixed 1 - + Vegetarian 2 - + Pastafarian 3 + + Allergies + text_box + + + + + How did you learn about this event? + simple_choice + + + + + Our website + 1 + + + + Commercials + 2 + + + + A friend + 3 + + diff --git a/addons/website_event_questions/data/event_registration_demo.xml b/addons/website_event_questions/data/event_registration_demo.xml index ac9c894d250..f2a10283f10 100644 --- a/addons/website_event_questions/data/event_registration_demo.xml +++ b/addons/website_event_questions/data/event_registration_demo.xml @@ -1,18 +1,41 @@ - - - + + + + + + - - + + Fish +Nuts + + - - + + + + - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/website_event_questions/models/event_event.py b/addons/website_event_questions/models/event_event.py index 3a7984a30a0..95d1d80a0f1 100644 --- a/addons/website_event_questions/models/event_event.py +++ b/addons/website_event_questions/models/event_event.py @@ -33,8 +33,13 @@ class EventEvent(models.Model): event.question_ids = [(5, 0, 0)] + [ (0, 0, { 'title': question.title, + 'question_type': question.question_type, 'sequence': question.sequence, 'once_per_order': question.once_per_order, + 'answer_ids': [(0, 0, { + 'name': answer.name, + 'sequence': answer.sequence + }) for answer in question.answer_ids], }) for question in event.event_type_id.question_ids ] diff --git a/addons/website_event_questions/models/event_question.py b/addons/website_event_questions/models/event_question.py index 1081f96f6c9..0eee8eef37b 100644 --- a/addons/website_event_questions/models/event_question.py +++ b/addons/website_event_questions/models/event_question.py @@ -12,9 +12,12 @@ class EventQuestion(models.Model): _description = 'Event Question' title = fields.Char(required=True, translate=True) + question_type = fields.Selection([ + ('simple_choice', 'Selection'), + ('text_box', 'Text Input')], default='simple_choice', string="Question Type", required=True) event_type_id = fields.Many2one('event.type', 'Event Type', ondelete='cascade') event_id = fields.Many2one('event.event', 'Event', ondelete='cascade') - answer_ids = fields.One2many('event.answer', 'question_id', "Answers", required=True, copy=True) + answer_ids = fields.One2many('event.question.answer', 'question_id', "Answers", copy=True) sequence = fields.Integer(default=10) once_per_order = fields.Boolean('Ask only once per order', help="If True, this question will be asked only once and its value will be propagated to every attendees." @@ -25,23 +28,37 @@ class EventQuestion(models.Model): if any(question.event_type_id and question.event_id for question in self): raise UserError(_('Question cannot belong to both the event category and itself.')) - @api.model - def create(self, vals): - event_id = vals.get('event_id', False) - if event_id: - event = self.env['event.event'].browse([event_id]) - if event.event_type_id.use_questions and event.event_type_id.question_ids: - vals['answer_ids'] = vals.get('answer_ids', []) + [(0, 0, { - 'name': answer.name, - 'sequence': answer.sequence, - }) for answer in event.event_type_id.question_ids.filtered(lambda question: question.title == vals.get('title')).mapped('answer_ids')] - return super(EventQuestion, self).create(vals) + def write(self, vals): + """ We add a check to prevent changing the question_type of a question that already has answers. + Indeed, it would mess up the event.registration.answer (answer type not matching the question type). """ + if 'question_type' in vals: + questions_new_type = self.filtered(lambda question: question.question_type != vals['question_type']) + if questions_new_type: + answer_count = self.env['event.registration.answer'].search_count([('question_id', 'in', questions_new_type.ids)]) + if answer_count > 0: + raise UserError(_("You cannot change the question type of a question that already has answers!")) + return super(EventQuestion, self).write(vals) -class EventAnswer(models.Model): - _name = 'event.answer' + def action_view_question_answers(self): + """ Allow analyzing the attendees answers to event questions in a convenient way: + - A graph view showing counts of each suggestions for simple_choice questions + (Along with secondary pivot and tree views) + - A tree view showing textual answers values for text_box questions. """ + self.ensure_one() + action = self.env.ref('website_event_questions.action_event_registration_report').read()[0] + action['domain'] = [('question_id', '=', self.id)] + if self.question_type == 'simple_choice': + action['views'] = [(False, 'graph'), (False, 'pivot'), (False, 'tree')] + elif self.question_type == 'text_box': + action['views'] = [(False, 'tree')] + return action + +class EventQuestionAnswer(models.Model): + """ Contains suggested answers to a 'simple_choice' event.question. """ + _name = 'event.question.answer' _order = 'sequence,id' - _description = 'Event Answer' + _description = 'Event Question Answer' name = fields.Char('Answer', required=True, translate=True) question_id = fields.Many2one('event.question', required=True, ondelete='cascade') diff --git a/addons/website_event_questions/models/event_registration.py b/addons/website_event_questions/models/event_registration.py index b8f23da99d7..eac70dd75f6 100644 --- a/addons/website_event_questions/models/event_registration.py +++ b/addons/website_event_questions/models/event_registration.py @@ -4,22 +4,25 @@ from odoo import fields, models -class EventRegistrationAnswer(models.Model): - ''' This m2m table has to be explicitly instanciated as we need unique ids - in the reporting view event.question.report. - - This model is purely technical. ''' - - _name = 'event.registration.answer' - _table = 'event_registration_answer' - _description = 'Event Registration Answer' - - event_answer_id = fields.Many2one('event.answer', required=True, ondelete='cascade') - event_registration_id = fields.Many2one('event.registration', required=True, ondelete='cascade') - - class EventRegistration(models.Model): """ Store answers on attendees. """ _inherit = 'event.registration' - answer_ids = fields.Many2many('event.answer', 'event_registration_answer', string='Answers') + registration_answer_ids = fields.One2many('event.registration.answer', 'registration_id', string='Attendee Answers') + +class EventRegistrationAnswer(models.Model): + """ Represents the user input answer for a single event.question """ + _name = 'event.registration.answer' + _description = 'Event Registration Answer' + + question_id = fields.Many2one('event.question', required=True, ondelete='cascade') + registration_id = fields.Many2one('event.registration', required=True, ondelete='cascade') + partner_id = fields.Many2one('res.partner', related='registration_id.partner_id') + event_id = fields.Many2one('event.event', related='registration_id.event_id') + question_type = fields.Selection(related='question_id.question_type') + value_answer_id = fields.Many2one('event.question.answer', string="Suggested answer") + value_text_box = fields.Text('Text answer') + + _sql_constraints = [ + ('value_check', "CHECK(value_answer_id IS NOT NULL OR COALESCE(value_text_box, '') <> '')", "There must be a suggested value or a text value.") + ] diff --git a/addons/website_event_questions/report/__init__.py b/addons/website_event_questions/report/__init__.py deleted file mode 100644 index bebed12eef7..00000000000 --- a/addons/website_event_questions/report/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import report_event_registrations_questions diff --git a/addons/website_event_questions/report/report_event_question_view.xml b/addons/website_event_questions/report/report_event_question_view.xml deleted file mode 100644 index a495d66fc7d..00000000000 --- a/addons/website_event_questions/report/report_event_question_view.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - event.question.report.graph - event.question.report - - - - - - - - - - - event.question.report.pivot - event.question.report - - - - - - - - - - - - - event.question.report.search - event.question.report - - - - - - - - - - - - - - - - - Questions Analysis - event.question.report - graph,pivot - - - - - - - diff --git a/addons/website_event_questions/report/report_event_registrations_questions.py b/addons/website_event_questions/report/report_event_registrations_questions.py deleted file mode 100644 index 6bbd52d043f..00000000000 --- a/addons/website_event_questions/report/report_event_registrations_questions.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import api, fields, models, tools - - -class ReportEventRegistrationQuestions(models.Model): - _name = "event.question.report" - _auto = False - _description = 'Event Question Report' - - attendee_id = fields.Many2one(comodel_name='event.registration', string='Registration') - question_id = fields.Many2one(comodel_name='event.question', string='Question') - answer_id = fields.Many2one(comodel_name='event.answer', string='Answer') - event_id = fields.Many2one(comodel_name='event.event', string='Event') - - def init(self): - """ Event Question main report """ - tools.drop_view_if_exists(self._cr, 'event_question_report') - self._cr.execute(""" CREATE VIEW event_question_report AS ( - SELECT - att_answer.id as id, - att_answer.event_registration_id as attendee_id, - answer.question_id as question_id, - answer.id as answer_id, - question.event_id as event_id - FROM - event_registration_answer as att_answer - LEFT JOIN - event_answer as answer ON answer.id = att_answer.event_answer_id - LEFT JOIN - event_question as question ON question.id = answer.question_id - GROUP BY - attendee_id, - event_id, - question_id, - answer_id, - att_answer.id - )""") diff --git a/addons/website_event_questions/security/ir.model.access.csv b/addons/website_event_questions/security/ir.model.access.csv index 79ab8690426..ea509ea3f85 100644 --- a/addons/website_event_questions/security/ir.model.access.csv +++ b/addons/website_event_questions/security/ir.model.access.csv @@ -1,7 +1,6 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink event_question_all,event.question.all,model_event_question,,1,0,0,0 event_question_event_user,event.question.event.user,model_event_question,event.group_event_user,1,1,1,1 -event_answer_all,event.answer.all,model_event_answer,,1,0,0,0 -event_answer_event_user,event.answer.event.user,model_event_answer,event.group_event_user,1,1,1,1 -event_question_report_all,event.question.report.all,model_event_question_report,event.group_event_user,1,1,1,1 -event_registration_answer_all,access_event_registration_answer,model_event_registration_answer,,1,1,1,1 +event_question_answer_all,event.question.answer.all,model_event_question_answer,,1,0,0,0 +event_question_answer_event_user,event.question.answer.event.user,model_event_question_answer,event.group_event_user,1,1,1,1 +event_registration_answer_event_user,event.registration.answer.event.user,model_event_registration_answer,event.group_event_user,1,1,1,1 diff --git a/addons/website_event_questions/static/tests/tours/tickets_questions.js b/addons/website_event_questions/static/tests/tours/tickets_questions.js new file mode 100644 index 00000000000..458ecc7eb90 --- /dev/null +++ b/addons/website_event_questions/static/tests/tours/tickets_questions.js @@ -0,0 +1,54 @@ +odoo.define('website_event_questions.tour_test_tickets_questions', function (require) { +'use strict'; + +var tour = require('web_tour.tour'); +tour.register('test_tickets_questions', { + test: true, + url: '/event' +}, [{ + content: "Click on the Design Fair event", + trigger: 'article:contains("Design Fair New York")', +}, { + content: "Click on Buy tickets button", + trigger: 'a:contains("Tickets")', +}, { + content: "Select 2 'Free' tickets to buy", + trigger: 'div.row:contains("Free") select.custom-select', + run: 'text 2' +}, { + content: "Click on Register tickets button", + trigger: 'button:contains("Register")', + run: 'click' +}, { + trigger: 'div:contains("Ticket #1").modal-body input[name*="name"]', + run: 'text Attendee A' +}, { + trigger: 'div:contains("Ticket #1").modal-body input[name*="email"]', + run: 'text attendee-a@gmail.com' +}, { + trigger: 'div:contains("Ticket #1").modal-body input[name*="phone"]', + run: 'text +32499123456' +}, { + trigger: 'div:contains("Ticket #1").modal-body select[name*="question_answer"]', + run: 'text Vegetarian' +}, { + trigger: 'div:contains("Ticket #1").modal-body textarea[name*="question_answer"]', + run: 'text Fish and Nuts' +}, { + trigger: 'div:contains("Ticket #2").modal-body input[name*="name"]', + run: 'text Attendee B' +}, { + trigger: 'div:contains("Ticket #2").modal-body input[name*="email"]', + run: 'text attendee-b@gmail.com' +}, { + trigger: 'div:contains("Ticket #2").modal-body select[name*="question_answer"]', + run: 'text Pastafarian' +}, { + trigger: 'div:contains("General questions").modal-body select[name*="question_answer"]', + run: 'text A friend' +}, { + trigger: 'button:contains("Continue")', + run: 'click' +}]); + +}); diff --git a/addons/website_event_questions/tests/__init__.py b/addons/website_event_questions/tests/__init__.py index d03842855ce..38db76983f5 100644 --- a/addons/website_event_questions/tests/__init__.py +++ b/addons/website_event_questions/tests/__init__.py @@ -3,3 +3,4 @@ from . import common from . import test_event_internals +from . import test_event_ui diff --git a/addons/website_event_questions/tests/common.py b/addons/website_event_questions/tests/common.py index 431eb1c376d..7ad2697a81f 100644 --- a/addons/website_event_questions/tests/common.py +++ b/addons/website_event_questions/tests/common.py @@ -12,6 +12,7 @@ class TestEventQuestionCommon(TestEventCommon): cls.event_question_1 = cls.env['event.question'].create({ 'title': 'Question1', + 'question_type': 'simple_choice', 'event_type_id': cls.event_type_complex.id, 'once_per_order': False, 'answer_ids': [ @@ -21,6 +22,7 @@ class TestEventQuestionCommon(TestEventCommon): }) cls.event_question_2 = cls.env['event.question'].create({ 'title': 'Question2', + 'question_type': 'simple_choice', 'event_type_id': cls.event_type_complex.id, 'once_per_order': True, 'answer_ids': [ @@ -28,4 +30,10 @@ class TestEventQuestionCommon(TestEventCommon): (0, 0, {'name': 'Q2-Answer2'}) ], }) + cls.event_question_3 = cls.env['event.question'].create({ + 'title': 'Question3', + 'question_type': 'text_box', + 'event_type_id': cls.event_type_complex.id, + 'once_per_order': True, + }) cls.event_type_complex.write({'use_questions': True}) diff --git a/addons/website_event_questions/tests/test_event_internals.py b/addons/website_event_questions/tests/test_event_internals.py index d3494cae49c..c2cfe1f40d1 100644 --- a/addons/website_event_questions/tests/test_event_internals.py +++ b/addons/website_event_questions/tests/test_event_internals.py @@ -23,13 +23,18 @@ class TestEventData(TestEventQuestionCommon): 'date_end': FieldsDatetime.to_string(datetime.today() + timedelta(days=15)), }) + self.assertEqual( + event.question_ids.mapped('question_type'), + ['simple_choice', 'simple_choice', 'text_box']) self.assertEqual(event.specific_question_ids.title, 'Question1') self.assertEqual( set(event.specific_question_ids.mapped('answer_ids.name')), set(['Q1-Answer1', 'Q1-Answer2'])) - self.assertEqual(event.general_question_ids.title, 'Question2') + self.assertEqual(len(event.general_question_ids), 2) + self.assertEqual(event.general_question_ids[0].title, 'Question2') + self.assertEqual(event.general_question_ids[1].title, 'Question3') self.assertEqual( - set(event.general_question_ids.mapped('answer_ids.name')), + set(event.general_question_ids[0].mapped('answer_ids.name')), set(['Q2-Answer1', 'Q2-Answer2'])) def test_process_attendees_form(self): @@ -45,20 +50,28 @@ class TestEventData(TestEventQuestionCommon): '1-email': 'pixis@gmail.com', '1-phone': '+32444444444', '1-event_ticket_id': '2', - '1-answer_ids-8': '5', '2-name': 'Geluchat', '2-email': 'geluchat@gmail.com', '2-phone': '+32777777777', '2-event_ticket_id': '3', - '2-answer_ids-8': '9', - '0-answer_ids-3': '7', - '0-answer_ids-4': '1', + 'question_answer-1-%s' % self.event_question_1.id: '5', + 'question_answer-2-%s' % self.event_question_1.id: '9', + 'question_answer-0-%s' % self.event_question_2.id: '7', + 'question_answer-0-%s' % self.event_question_3.id: 'Free Text', } with MockRequest(self.env): registrations = WebsiteEvent()._process_attendees_form(event, form_details) self.assertEqual(registrations, [ - {'name': 'Pixis', 'email': 'pixis@gmail.com', 'phone': '+32444444444', 'event_ticket_id': 2, 'answer_ids': [[4, 5], [4, 7], [4, 1]]}, - {'name': 'Geluchat', 'email': 'geluchat@gmail.com', 'phone': '+32777777777', 'event_ticket_id': 3, 'answer_ids': [[4, 9], [4, 7], [4, 1]]} + {'name': 'Pixis', 'email': 'pixis@gmail.com', 'phone': '+32444444444', 'event_ticket_id': 2, + 'registration_answer_ids': [ + (0, 0, {'question_id': self.event_question_1.id, 'value_answer_id': 5}), + (0, 0, {'question_id': self.event_question_2.id, 'value_answer_id': 7}), + (0, 0, {'question_id': self.event_question_3.id, 'value_text_box': 'Free Text'})]}, + {'name': 'Geluchat', 'email': 'geluchat@gmail.com', 'phone': '+32777777777', 'event_ticket_id': 3, + 'registration_answer_ids': [ + (0, 0, {'question_id': self.event_question_1.id, 'value_answer_id': 9}), + (0, 0, {'question_id': self.event_question_2.id, 'value_answer_id': 7}), + (0, 0, {'question_id': self.event_question_3.id, 'value_text_box': 'Free Text'})]} ]) diff --git a/addons/website_event_questions/tests/test_event_ui.py b/addons/website_event_questions/tests/test_event_ui.py new file mode 100644 index 00000000000..fdebd0c40a7 --- /dev/null +++ b/addons/website_event_questions/tests/test_event_ui.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from dateutil.relativedelta import relativedelta + +from odoo import fields, tests + + +@tests.tagged('post_install', '-at_install') +class TestUi(tests.HttpCase): + + def test_01_tickets_questions(self): + """ Will execute the tour that fills up two tickets with a few questions answers + and then assert that the answers are correctly saved for each attendee. """ + + self.design_fair_event = self.env['event.event'].create({ + 'name': 'Design Fair New York', + 'date_begin': fields.Datetime.now() - relativedelta(days=15), + 'date_end': fields.Datetime.now() + relativedelta(days=15), + 'event_ticket_ids': [(0, 0, { + 'name': 'Free', + 'start_sale_date': fields.Datetime.now() - relativedelta(days=15) + }), (0, 0, { + 'name': 'Other', + 'start_sale_date': fields.Datetime.now() - relativedelta(days=15) + })], + 'website_published': True, + 'question_ids': [(0, 0, { + 'title': 'Meal Type', + 'question_type': 'simple_choice', + 'answer_ids': [ + (0, 0, {'name': 'Mixed'}), + (0, 0, {'name': 'Vegetarian'}), + (0, 0, {'name': 'Pastafarian'}) + ] + }), (0, 0, { + 'title': 'Allergies', + 'question_type': 'text_box' + }), (0, 0, { + 'title': 'How did you learn about this event?', + 'question_type': 'simple_choice', + 'once_per_order': True, + 'answer_ids': [ + (0, 0, {'name': 'Our website'}), + (0, 0, {'name': 'Commercials'}), + (0, 0, {'name': 'A friend'}) + ] + })] + }) + + self.start_tour("/", 'test_tickets_questions', login="portal") + + registrations = self.env['event.registration'].search([ + ('email', 'in', ['attendee-a@gmail.com', 'attendee-b@gmail.com']) + ]) + self.assertEqual(len(registrations), 2) + first_registration = registrations.filtered(lambda reg: reg.email == 'attendee-a@gmail.com') + second_registration = registrations.filtered(lambda reg: reg.email == 'attendee-b@gmail.com') + self.assertEqual(first_registration.name, 'Attendee A') + self.assertEqual(first_registration.phone, '+32499123456') + self.assertEqual(second_registration.name, 'Attendee B') + + event_questions = registrations.mapped('event_id.question_ids') + self.assertEqual(len(event_questions), 3) + + first_registration_answers = first_registration.registration_answer_ids + self.assertEqual(len(first_registration_answers), 3) + + self.assertEqual(first_registration_answers.filtered( + lambda answer: answer.question_id.title == 'Meal Type' + ).value_answer_id.name, 'Vegetarian') + + self.assertEqual(first_registration_answers.filtered( + lambda answer: answer.question_id.title == 'Allergies' + ).value_text_box, 'Fish and Nuts') + + self.assertEqual(first_registration_answers.filtered( + lambda answer: answer.question_id.title == 'How did you learn about this event?' + ).value_answer_id.name, 'A friend') + + second_registration_answers = second_registration.registration_answer_ids + self.assertEqual(len(second_registration_answers), 2) + + self.assertEqual(second_registration_answers.filtered( + lambda answer: answer.question_id.title == 'Meal Type' + ).value_answer_id.name, 'Pastafarian') + + self.assertEqual(first_registration_answers.filtered( + lambda answer: answer.question_id.title == 'How did you learn about this event?' + ).value_answer_id.name, 'A friend') diff --git a/addons/website_event_questions/views/assets.xml b/addons/website_event_questions/views/assets.xml new file mode 100644 index 00000000000..d85a4bda615 --- /dev/null +++ b/addons/website_event_questions/views/assets.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/addons/website_event_questions/views/event_question_views.xml b/addons/website_event_questions/views/event_question_views.xml new file mode 100644 index 00000000000..3fec664ea5b --- /dev/null +++ b/addons/website_event_questions/views/event_question_views.xml @@ -0,0 +1,35 @@ + + + + event.question.view.form + event.question + +
+ +

+ + +
+ +
+ +
+
+ + + + + + + + + + + + +
+
+
+
+
diff --git a/addons/website_event_questions/views/event_registration_answer_views.xml b/addons/website_event_questions/views/event_registration_answer_views.xml new file mode 100644 index 00000000000..fac4cd9d05b --- /dev/null +++ b/addons/website_event_questions/views/event_registration_answer_views.xml @@ -0,0 +1,55 @@ + + + + event.registration.answer.view.search + event.registration.answer + + + + + + + + + + + event.registration.answer.view.tree + event.registration.answer + + + + + + + + + + + + + event.registration.answer.view.graph + event.registration.answer + + + + + + + + + event.registration.answer.view.pivot + event.registration.answer + + + + + + + + + + Answer Breakdown + event.registration.answer + search,tree,graph,pivot + + diff --git a/addons/website_event_questions/views/event_registration_views.xml b/addons/website_event_questions/views/event_registration_views.xml new file mode 100644 index 00000000000..e2ff64cc14c --- /dev/null +++ b/addons/website_event_questions/views/event_registration_views.xml @@ -0,0 +1,27 @@ + + + + event.registration.view.form.inherit.question + event.registration + + + + + + + + + + + + + + + + + + + + diff --git a/addons/website_event_questions/views/event_templates.xml b/addons/website_event_questions/views/event_templates.xml index 5b63aaa9321..ef6d1a4c791 100644 --- a/addons/website_event_questions/views/event_templates.xml +++ b/addons/website_event_questions/views/event_templates.xml @@ -7,12 +7,9 @@
-
@@ -21,14 +18,12 @@