Skip to Content
Menu
This question has been flagged
1 Reply
1586 Views

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
Discard
Best Answer

Hello
Andi Akbarry Renaldy

Please Find code in Comment. 

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

Avatar
Discard

@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>

Author

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>

Author

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

Related Posts Replies Views Activity
0
Apr 24
223
0
Mar 15
3298
1
Feb 24
507
2
Jan 24
728
0
Aug 21
2229