Response body is not available to scripts (Reason: CORS No Allow Credentials) how to solve this problem in browser , i can not send request using axios with withCredentials: true to set the cookie automaticly in browser
Hi, I have a problem. I did all such as you mentioned and it works in Postman, but from an Android App my custom services return a 404 Not found, in postman they return the data OK, But from my Android App I can use the authenticate because it is from factory in Odoo but my customs services not.
I also had this problem. I use Volley. I was able to recover the data by putting session_id in the cookies headers.put("Cookie", "session_id="+session_id);
hi how to pass login information on url to auto login http for example I want open odoosite.com/web?login=login&password=password and return logged in user site on odoo 14 ver
Hi. This video was a great help for me. Now I have a big problem..How can I create new users from external apps without use admin password. Just a form,.send new user data, and create user in odoo. I have tryed no positive results. Because i can not write those records.
You can try to use the concept of how the default sign up works in odoo. Can you have a look at this controller and see, whether it helps: @http.route('/web/signup', type='http', auth='public', website=True, sitemap=False)
@@misterg38 I did it like image_url_1920 = 'your_url' + '/web/image?' + 'model=hr.employee&id=' + str( rec.id) + '&field=image_128' Where i write your_url you can use web.base.url but it wasn't helpful in my case.
Thank you for the video. I have a problem here, when you use the session ID the you got after authentication in order to get information from Odoo, it succeeds. But I don't think it succeeds because you used the session ID but because Postman created a cookie and used it for authentication. To check this point, You may provide a false Session ID or delete it and the request will work - or you may use the session ID as usual but before that try to delete the cookie from Postman because that's what happens with me every time.
This method will work while creating the mobile application :) Regarding the cookie in postman you can remove the cookies and try with the authenticated session_id , if there is only valid session_id it will work
Hello Sir desktop-42vq205:8069/web/session/authenticate If I call thest localhost I get an error of [ Bad Request Session expired (invalid CSRF token) ] why? please tell me
amazing!! huge thanks, this will definitely help us creating real Mobile Apps for Odoo. just wants to ask as I am using odoo 14, will all steps works as it is now or something deprecated and there is any upgraded / updated things to achieve the same? be blessed :)
@@OdooMates thanks, yes you were right, i can connect but Postman not showing "session id" as in your video, how i can have it to go further? i am stuck, how i can follow this video to achieve POST method? please help. be blessed :)
Nice. can you please tell me how to signup a user(portal) . so he can make new orders (eCommerce) and do other stuffs? i created a user by signing with an admin account first(to res.users) and right after the creation authenticated the new user by calling /web/session/authenticate but this user(portal) doesn't have access to make a new order(sale.order). can you please tell me how can i achieve this. please reply. thank you
It's working but as I checked, the session_id will expire after certain period of time. Then the API will not work. What should I do in that case. And second thing, in case of GET requests, we have to pass something in body. And is there any way to change the structure of response ?
session_id will be expiring only after one or two week of inactivity from this session. If he is logging into the app daily or weekly it wont get expired
@@OdooMates in android app, no one logins every day or weekly... Means if a user logged in then it shouldn't be automatically logged out... But in case of session id it'll log out automatically after some weeks...
This is very helpful. The authentication API used in the video accepts username and password. If we want to achieve the similar behaviour with oAuth login what will be the authentication API in Odoo 13?
@@OdooMates Can you please throw some insight on how to update the "Access-Control-Allow-Headers" header to manage the CORS issue when the origin is different for Odoo server and web application. Thank you :)
We recently started a series showing how to customize Odoo without code, I think it will be useful for the Odoo online users . If this is not the question, let us know
@@OdooMates Yes, I loved those videos too :-) But here, I am talking about creating the controller for REST APIs which you created. Is it possible to achieve the same from Online Instance?
@@OdooMates Same purpose as this video sir, creating custom android/iOS applications or extend via third party application. :-) I am not aware if is there any other way to do so for the online instances.
Thanks for time giving to this world...! Nice video. I have also create module and controller like your video and jd_id = request.env['mymdule'].sudo().create(jddict).. throw the error on here TypeError: 'mymodule' object is not callable. Why this error coming. Exact done like your video.
for designing the login page you need to know android development or support from an android developer, regarding the authentication functionality is explained in this video
@@OdooMates I want to customize the Odoo app or rather simplify it Modification of the application does not include its algorithms, but I will give you an example Hide some buttons that the user does not need Like the tax button Payment terms and conditions Electronic signature and online payment And some tabs that the user does not need Change the color of the program, buttons and logo This is about the shape As for the content area? Export the list of products, customers and suppliers from the datagridview to the application database Adjust product prices through the desktop program Import sales from the app to the desktop app and mark them as imported Import Payments Per Customer
Omg Life saver Proud of you Odoo mates Always be happy life
Glad to hear that
Great Tutorial buddy ... Thank you for your wonderful contribution.. Keep it up
Glad it helped
great work Odoo Mates. way to go. ❤❤
thanks bro
best Video for Odoo API tutorial, man you need 1 Mill Views
Thanks brother :)
Thank You!
It helped a lot.
Happy to hear it :)
Thank You!
Is an excellent Video
Muchas Gracias me ayudo mucho, muy bien explicado
Thanks for the support :)
Thanks for this video, very useful.
Glad to hear that!
This is so helpful
Thanks brother :)
thank you
welcome :)
After getting session id how to redirect to odoo without login from external application?
This is so much helpful.
Quick question, suppose if we provide non admin credentials and get session key, does it take care of permissions etc?
yes it will be based on the access rights set to the given user login
Hi bro i have one question. If user enable mfa. How to get session_id
Response body is not available to scripts (Reason: CORS No Allow Credentials)
how to solve this problem in browser , i can not send request using axios with withCredentials: true to set the cookie automaticly in browser
Thanks for the video,
Question. Can i reduce response fields in session info?
yes its possible
cansado
Hi, I have a problem. I did all such as you mentioned and it works in Postman, but from an Android App my custom services return a 404 Not found, in postman they return the data OK, But from my Android App I can use the authenticate because it is from factory in Odoo but my customs services not.
did you call rest of the api with session_id ?
I also had this problem. I use Volley. I was able to recover the data by putting session_id in the cookies
headers.put("Cookie", "session_id="+session_id);
hi how to pass login information on url to auto login http
for example I want open
odoosite.com/web?login=login&password=password
and return logged in user site on
odoo 14 ver
It doesnt work, if u using postman the cookie save the session id. But in android apps its not working at all .
in android the session has to be store and passed in the request header
How to attache the file in Json format brother
Even I didn't put X-Openerp, and it still can get data! I think it is secure! Is there any way besides this?
What you get in response
Hi. This video was a great help for me. Now I have a big problem..How can I create new users from external apps without use admin password. Just a form,.send new user data, and create user in odoo. I have tryed no positive results. Because i can not write those records.
You can try to use the concept of how the default sign up works in odoo. Can you have a look at this controller and see, whether it helps:
@http.route('/web/signup', type='http', auth='public', website=True, sitemap=False)
There is no session_id in Odoo 14
Hey odoo mates,can you guide us about how to get one2many field from an API call? field like order_line in sale. Thanks
you can prepare a dictionary from the one2many lines and pass it from the API
Here session id is coming with expiry date, will it expires on respective date and we have generate new session id again ?
Of now yes
can i use in default crm module as i am not working on custom module?
You can use default crm module, if you need to create record in odoo from third party apps, see this: ruclips.net/video/Ckq95uHuoUQ/видео.html
What I have to add in get_patients controller, in order to get just one patient by its ID? Thank you.
add a argument in function to receive the id of patient, then based on it, you can search and return
Hey what to do to get image of employee? its returning a very long string in json
save it as an attachment and return the url of the attachment to mobile app
@@OdooMates How?
@@misterg38 I did it like image_url_1920 = 'your_url' + '/web/image?' + 'model=hr.employee&id=' + str(
rec.id) + '&field=image_128'
Where i write your_url you can use web.base.url but it wasn't helpful in my case.
Thank you for the video.
I have a problem here, when you use the session ID the you got after authentication in order to get information from Odoo, it succeeds.
But I don't think it succeeds because you used the session ID but because Postman created a cookie and used it for authentication.
To check this point,
You may provide a false Session ID or delete it and the request will work - or you may use the session ID as usual but before that try to delete the cookie from Postman because that's what happens with me every time.
This method will work while creating the mobile application :) Regarding the cookie in postman you can remove the cookies and try with the authenticated session_id , if there is only valid session_id it will work
@@OdooMates But in Odoo 13, there's no session_id in the response.
@@ehabmosilhy It has been moved to cookies
@@ehabmosilhy ruclips.net/video/Lvq73jbygFE/видео.html
@@OdooMates Thanks for this info. But how can I send it in a response?
Hello Sir
desktop-42vq205:8069/web/session/authenticate
If I call thest localhost I get an error of [ Bad Request
Session expired (invalid CSRF token) ] why? please tell me
did you solved this ?
amazing!! huge thanks, this will definitely help us creating real Mobile Apps for Odoo. just wants to ask as I am using odoo 14, will all steps works as it is now or something deprecated and there is any upgraded / updated things to achieve the same? be blessed :)
There is a slight change in getting session id, it will be inside the cookies, rest of them will remain same
@@OdooMates thanks, yes you were right, i can connect but Postman not showing "session id" as in your video, how i can have it to go further? i am stuck, how i can follow this video to achieve POST method? please help. be blessed :)
@@ahmedharoon2740 See this video especially for odoo13 and higher: ruclips.net/video/Lvq73jbygFE/видео.html
@@OdooMates thanks a bunch for your help... will check the video and comment there. be blessed :)
@@ahmedharoon2740 happy to help :)
Hello nice tutorial. Is there any repo where we can get source code sample please ?
You can search Odoo development tutorial in Odoo apps or search odoo mages github
Nice. can you please tell me how to signup a user(portal) . so he can make new orders (eCommerce) and do other stuffs?
i created a user by signing with an admin account first(to res.users) and right after the creation authenticated the new user by calling /web/session/authenticate but this user(portal) doesn't have access to make a new order(sale.order). can you please tell me how can i achieve this.
please reply. thank you
is the question related to mobile app development or normal odoo, like how to do sign up in odoo ?
@@OdooMates mobile app development
@@OdooMatesi'm developing a flutter app using this library
pub.dev/documentation/odoo_api/latest/
It's working but as I checked, the session_id will expire after certain period of time.
Then the API will not work. What should I do in that case.
And second thing, in case of GET requests, we have to pass something in body.
And is there any way to change the structure of response ?
session_id will be expiring only after one or two week of inactivity from this session. If he is logging into the app daily or weekly it wont get expired
the second part of the questions, you are asking about how to update the response of the authentication ?
@@OdooMates in android app, no one logins every day or weekly... Means if a user logged in then it shouldn't be automatically logged out... But in case of session id it'll log out automatically after some weeks...
Because there's an expiration date of the session id in cookies
@@OdooMates the second part... I want to update/change the response structure of all APIs as in case of get API, it asks for something in body...
This is very helpful.
The authentication API used in the video accepts username and password. If we want to achieve the similar behaviour with oAuth login what will be the authentication API in Odoo 13?
you can use the same api itself, just enable auth login in the database, this will work for it too
@@OdooMates Thanks for the response. 🙏
Glad to help
@@OdooMates Can you please throw some insight on how to update the "Access-Control-Allow-Headers" header to manage the CORS issue when the origin is different for Odoo server and web application. Thank you :)
Did you set the session id in the cookie
how to get user profile picture?
i dont see session_id in my response, im using odoo 16
ruclips.net/video/Lvq73jbygFE/видео.html
Hey, Very Nice Video! I wanted to what are the options for Odoo Online Instances? Where we don't have access to the code?
We recently started a series showing how to customize Odoo without code, I think it will be useful for the Odoo online users . If this is not the question, let us know
@@OdooMates Yes, I loved those videos too :-) But here, I am talking about creating the controller for REST APIs which you created. Is it possible to achieve the same from Online Instance?
What is the purpose of looking for creating rest APIs for Odoo online instance ?
@@OdooMates Same purpose as this video sir, creating custom android/iOS applications or extend via third party application. :-)
I am not aware if is there any other way to do so for the online instances.
thank you sir ... can u tell us how to use api key on odoo 14?
For odoo13 and above: ruclips.net/video/Lvq73jbygFE/видео.html
@@OdooMates sir not Session ID but API key
May I know API key of which process ?
Go to user settings in odoo, generate API key on the user. Use this key as password in your python files
Can I ask what language are you using for Odoo? Thank you
python, xml and js
Thanks for time giving to this world...! Nice video. I have also create module and controller like your video and jd_id = request.env['mymdule'].sudo().create(jddict).. throw the error on here TypeError: 'mymodule' object is not callable. Why this error coming. Exact done like your video.
What is your model name
_name = 'mymodule'
Hi, Odoo Mates, Woudl like to get paid service from your side. Kindly tell me how I contact you.
If the controller works. If we have multiple databases .
You have to use db_filter then
i want to learn how to odoo login page in android ??
for designing the login page you need to know android development or support from an android developer, regarding the authentication functionality is explained in this video
okk
@@niralidarji3378 :)
Function declared as capable of handling request of type 'json' but called with a request of type 'http'
change the controller type to http or initiate json request
@@OdooMates it run in Postman with Json but in URL same ERROR
@@kenzasouabni if you are running in browser it will be http request
@OdooMates: Can I get the source code Please?
You can get it from Odoo app store or from our github repository
@@OdooMates what's the app name? Or could you please share me the github repo?
You can make a search of Odoo mates github
Hello, where is your tutorial on the controller?
ruclips.net/video/udqdjmUN_2c/видео.html
@@OdooMates Thk u for ur fast feedback
@@salama8891 welcome brother
en odoo 15 no existe la propiedada session_id
ruclips.net/video/Lvq73jbygFE/видео.html
@@OdooMates gracias lo probaré mañana
have big request
Have a biz request plz brother create mobile app development for odoo16
you can follow same steps in odoo 16 also
@@OdooMates but odoo 16 have not session authentication
how to return o2m field sir?
send it as a list of dictionary
@@OdooMatesthank you sir, i get it!
@@iGuntaram it is basic python, you can iterate the one2many field over a for loop and create a dict and append it to a list.
@@iGuntaram Sample:
list_val = []
for line in self.order_line:
vals = {
'id': line.id
}
list_val.append(vals)
is there a kotlin version?
not yet into this language, but you can check this, communicating with odoo using java: ruclips.net/video/isjhwKAL63M/видео.html
Brother please create APi for odoo16
sure, will do in upcoming days
@@OdooMates ok bro i am wait
where is Mobile Application
that has to be designed separately, using this api end points
cc
give me a om hospital code
apps.odoo.com/apps/modules/15.0/om_hospital/
You can offer me this service for a fee
building api's for mobile app development ?
@@OdooMates no
@@communehassibahbah5984 then ?
@@OdooMates I want to customize the Odoo app or rather simplify it Modification of the application does not include its algorithms, but I will give you an example Hide some buttons that the user does not need Like the tax button Payment terms and conditions Electronic signature and online payment And some tabs that the user does not need Change the color of the program, buttons and logo This is about the shape As for the content area? Export the list of products, customers and suppliers from the datagridview to the application database Adjust product prices through the desktop program Import sales from the app to the desktop app and mark them as imported Import Payments Per Customer