Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
1459 Widoki

Hello odoo community

I'm fairly new to odoo. I have an odoo application as my backend and a frontend web-app with just basic html,css and js.

Now i want to send a request to the /web/webclient/version_info endpoint which is created by odoo itself so i dont want to change anything on this endpoint. But no matter how i sent the request it always has issues with cors or the headers are not set correctly or the content which im sending is not the correct type (i know it is). I know setting cors='*' would solve the problem but i dont want to do that. I also tried using jsonp but that doesnt let me set a custom header and i also need to set one.

So my question is has anybody experienced this before and could maybe post a sample on how they are sending their request from their frontend web-app to this odoo endpoint?

Here the endpoint im talking about in the webclient.py file

@http.route('/web/webclient/version_info', type='json', auth="none")
def version_info(self):
return odoo.service.common.exp_version()


Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

For example you can trigger the end point from the post man application as follows:




Sample code in JS (Jquery)


Thanks

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
paź 24
1334
0
lip 25
4049
1
kwi 25
2023
2
lut 25
1784
0
wrz 23
8255