Hi,
I would to create a record in my custom module from a form in website page.
I created a controller to do so, It works, It creates the record but when I want to show a "thank you" page It returns this error:
This is my sample form:
action="/custom_module/create_record" method="post" data-model_name="" data-success_page="/contactus-thank-you" class="s_website_form form-horizontal container-fluid mt32"
And this is my controller:
@http.route('/custom_module/create_record', methods=['POST'], type='http', auth='public', website=True) defcreate_complaint(self, **kwargs): request.env['custom_module'].sudo().create({'employee_id': 1}) return request.render('website.contactus_thanks', {})
The controller work but It won't redirect.
It's everything a sample, I don't care of which field I send to backend at this moment, I just would to know why I can't redirect to another page when I perform my function.
Any help would be appreciated, thanks in advance.