Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2706 มุมมอง

Hi everyone,

I´ve created a custom website form where collect data from people. These people could be already contact so one field of the form is contact_related. I can get contact and show it in a datalist but I can´t save it the controller to create a new record.

Note: I´m able to record all the others fields but not contact related


 
@http.route('/crear/registro', type="http", auth='public', website=True)
def create_registry(self, **kw):
image = kw.get('attachment', False)
kw.update({
'attachment': base64.encodestring(image.read()) if image else False

})
request.env['feria.registro'].sudo().create(kw)

return request.render("feria.registry_thanks", {})

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You have to create a form in your view and then connect the form to the controller method to pass the values to be saved in database.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.พ. 24
5383
1
มิ.ย. 23
5632
2
พ.ค. 22
15130
Data from website with controller แก้ไขแล้ว
2
ก.ค. 24
4216
2
พ.ค. 25
9879