Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Invalid CSRF Token Odoo

By
Odoo
on 6/1/16, 2:40 AM 904 views

I got below error why? 


Invalid CSRF Token Odoo

Odoo URLs are CSRF-protected by default (when accessed with unsafe

HTTP methods). See

https://www.odoo.com/documentation/9.0/reference/http.html#csrf for

more details.

* if this endpoint is accessed through Odoo via py-QWeb form, embed a CSRF

token in the form, Tokens are available via `request.csrf_token()`

can be provided through a hidden input and must be POST-ed named

`csrf_token` e.g. in your form add:

<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>

* if the form is generated or posted in javascript, the token value is

available as `csrf_token` on `web.core` and as the `csrf_token`

value in the default js-qweb execution context

* if the form is accessed by an external third party (e.g. REST API

endpoint, payment gateway callback) you will need to disable CSRF

protection (and implement your own protection if necessary) by

passing the `csrf=False` parameter to the `route` decorator.

0
Sonia
On 6/8/16, 10:43 PM

Hi Jérémy

How can i mark my route as supported 'non crsf' submit?

0

Jérémy Kersten (jke)

--Jérémy Kersten (jke)--
2993
| 3 2 5
Jodoigne, Belgium
--Jérémy Kersten (jke)--

Jérémy is a member of the core R&D team since september 2013. He developed several projects for OpenERP version 8 including the eCommerce, the Google Calendar synchronization and the new product variants/configurator. Now, he manages Odoo website and themes for saas.

Jérémy Kersten (jke)
On 6/1/16, 9:38 AM

because you need to add the csrf in your form

or mark your route as supported 'non crsf' submit


Exactly what is explain in your message...


What are you trying to do ? 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 6/1/16, 2:40 AM
Seen: 904 times
Last updated: 6/8/16, 10:43 PM