跳至内容
菜单
此问题已终结
1 回复
2760 查看

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
形象
丢弃
最佳答案

Hello
Andi Akbarry Renaldy

Please Find code in Comment. 

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

形象
丢弃

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

编写者

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>

编写者

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

相关帖文 回复 查看 活动
0
4月 24
989
0
3月 15
4127
1
2月 24
1748
2
1月 24
1896
0
8月 21
3145