跳至內容
選單
此問題已被標幟
1 回覆
2610 瀏覽次數

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
2月 24
5226
1
6月 23
5480
2
5月 22
15068
2
7月 24
4165
2
5月 25
9746