Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2621 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
feb 24
5257
1
giu 23
5508
2
mag 22
15074
2
lug 24
4173
2
mag 25
9760