Skip to content
Extraits de code Groupes Projets
Valider c02fcc5a rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

[FIX] keep default fields from registrations

parent b72e3f65
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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 = {}
......
......@@ -178,22 +178,29 @@
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">
<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"
......@@ -205,6 +212,7 @@
/>
</div>
</div>
</t>
</xpath>
</template>
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter