Skip to Content
मेन्यू
This question has been flagged
1 Reply
2594 Views

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", {})

Avatar
Discard
Best Answer

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.

Avatar
Discard
Related Posts Replies Views Activity
2
फ़र॰ 24
5204
1
जून 23
5461
2
मई 22
15064
2
जुल॰ 24
4158
2
मई 25
9722