Ir al contenido
Menú
Se marcó esta pregunta

I have created a custom form in Odoo17, with this controller getting the data from the input through an http route: 


from odoo.http import request, Controller, route

@route('/form', auth='public', website=True)
def form(self, **kwargs):
error_message = request.session.pop('error_message', None)
return request.render('module.form_template', {'error_message': error_message,})


@route('/form/submit', type='http', auth='public', website=True, methods=['POST', 'GET'])
def form_submit(self, **post):
...


and from the xml, I have a form: 

 

form action="/form/submit" method="POST" enctype="multipart/form-data" class="o_mark_required" data-mark="*"
data-model_name="" data-success-page=""
input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"


and some inputs: 


input class="form-control s_website_form_input"
name="input_id" required="1"
placeholder="Please fill the input"
t-att-value="input_id"
t-att-disabled="condition"


Locally everything is working fine, the form gets submitted etc.

But when deployed and built in Odoo sh, I receive this:

Request URL:https://....odoo.com/form/submit
Request Method:POST
Status Code:303 See Other
Remote Address:xx.xxx.xx.xxx:xxx
Referrer Policy:strict-origin-when-cross-origin

Does any of you know or have a hint on what is wrong with the above or what exactly what might happen for this to appear? 


Thank you! 




Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 18
12808
1
jun 15
7391
1
mar 15
13493
4
oct 20
5170
2
mar 16
4011