Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2756 Näkymät

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
Hylkää
Paras vastaus

Hello
Andi Akbarry Renaldy

Please Find code in Comment. 

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

Avatar
Hylkää

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

Tekijä

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>

Tekijä

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

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
huhtik. 24
986
0
maalisk. 15
4125
1
helmik. 24
1743
2
tammik. 24
1893
0
elok. 21
3139