diff --git a/controllers/website_event.py b/controllers/website_event.py index 4ce203e1c5149244c374dfee9dec4a3422211879..b9acfedc842970cd255521664c37fe3991f0e75f 100644 --- a/controllers/website_event.py +++ b/controllers/website_event.py @@ -11,9 +11,7 @@ from odoo.addons.website_event_questions.controllers.main import WebsiteEvent class WebsiteEventPartnerQuestion(WebsiteEvent): def _process_attendees_form(self, event, form_details): - """Process data posted from the attendee details form. - Extracts question answers: - - For questions of type 'multiple_choice', extracting the suggested answer id""" + """Process data posted from the attendee details form.""" registrations = super()._process_attendees_form(event, form_details) fields_to_update = {} diff --git a/templates/event_registration_template.xml b/templates/event_registration_template.xml index 63e6b1e502e0c7127be8bd1e3d893fb73d8b9b10..c2663b5963b69297fdd9ee8c52fe112c54d6edac 100644 --- a/templates/event_registration_template.xml +++ b/templates/event_registration_template.xml @@ -178,33 +178,41 @@ priority="101" > <!-- - in case question_ids are defined, user is connected and we are registering for the first ticket - we hide the 3 default fields and replace by partner related questions + Phone is only displayed if user not connected or if we are not registering the + first contact --> <xpath - expr="//t[@name='attendee_loop']//*[hasclass('modal-body')]/div[hasclass('row')]" + expr="//t[@name='attendee_loop']//*[hasclass('modal-body')]/div[hasclass('row')]/div[input[@type='tel']]" position="attributes" > <attribute name="t-if" - >not event.partner_question_ids or request.env.user._is_public() or counter > 1</attribute> + >request.env.user._is_public() or counter > 1</attribute> </xpath> + <!-- + in case question_ids are defined, user is connected and we are registering for + the first ticket, question_ids are displayed + --> <xpath expr="//t[@name='attendee_loop']//*[hasclass('modal-body')]/div[hasclass('row')]" position="after" > - <div t-else="" class="my-4"> - <div - t-foreach="event.partner_question_ids" - t-as="question" - class="row" - t-att-name="question.title" - > - <t - t-call="solagro_website_event_partner.registration_event_partner_question" - /> + <t + t-if="event.partner_question_ids and not request.env.user._is_public() and counter == 1" + > + <div class="my-4"> + <div + t-foreach="event.partner_question_ids" + t-as="question" + class="row" + t-att-name="question.title" + > + <t + t-call="solagro_website_event_partner.registration_event_partner_question" + /> + </div> </div> - </div> + </t> </xpath> </template>