Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2736 Weergaven

Hello All,
I want to customize the popup display on the event registration form, is it possible to add many2one fields?

here's the controller I've added

@http.route(['''/event//registration/new'''], type='http', auth="public", website=True, sitemap=False)
def event_registration(self, **kw):
print("Execution Here 2.....................")
institusi_rec = http.request.env['res.partner.institusi'].sudo().search([])
values = {'institusi_rec': institusi_rec
}
return http.request.render("website_event_ylc.registration_attendee_details", values)
is there something missing with my code? because the value of the institution_rec still can't be displayed
Avatar
Annuleer
Beste antwoord

Hello
Andi Akbarry Renaldy

Please Find code in Comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Annuleer

@http.route(['''/event//registration/new'''], type='http', auth="public", website=True, sitemap=False)
def event_registration(self, **kw):
print("Execution Here 2.....................")
institusi_rec = http.request.env['res.partner.institusi'].sudo().search([])
values = {'institusi_rec': institusi_rec
}
return http.request.render("website_event_ylc.registration_attendee_details", values)

=> Template
<select name="institusi_rec">
<option value="">Institute</option>
<t t-foreach="institusi_rec" t-as="rec">
<option t-att-value="rec.id">
<t t-esc="rec.name" />
</option>
</t>
</select>

Auteur

Hello Jainesh Shah thankyou for your response, but the value many2one from model res.partner.institusi still not showing

here the screenshoot bellow i mean

https://i.postimg.cc/gJKb2DVV/Selection-003.png

I want to change the column that I marked on event registration popup to many2one

Hello Andi Akbarry Renaldy ,

please try this in XML

<template id="registration_attendee_details_custome" inherit_id="website_event.registration_attendee_details">
<xpath expr="//input[@type='email']" position="replace">
<select name="email">
<option value="">email</option>
<t t-foreach="institusi_rec" t-as="rec">
<option t-att-value="rec.email">
<t t-esc="rec.email" />
</option>
</t>
</select>
</xpath>
</template>

Auteur

looks like the problem is with http.route, but I don't have any idea because popup wizard display doesn't have url like /event//registration/new

Gerelateerde posts Antwoorden Weergaven Activiteit
0
apr. 24
977
0
mrt. 15
4122
1
feb. 24
1737
2
jan. 24
1887
0
aug. 21
3126