콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2889 화면

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
5662
1
6월 23
5936
2
5월 22
15262
2
7월 24
4427
2
5월 25
10065