Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2767 Lượt xem

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
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello
Andi Akbarry Renaldy

Please Find code in Comment. 

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

Ảnh đại diện
Huỷ bỏ

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

Tác giả

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>

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 4 24
991
0
thg 3 15
4131
1
thg 2 24
1756
2
thg 1 24
1899
0
thg 8 21
3151