Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added legacy mode for Odoo 7.0 and prior #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

natinusala
Copy link

I fixed the session_id bug encountered with Odoo 8.0+ by adding a legacy boolean (false by default) in the constructor. If the legacy mode is enabled, the session_id attribute will be added to the JSON requests.

I tested it on the 107189-8-0-38c9de Odoo 8.0 runbot and the connection works. I couldn't test further because I couldn't get a working example (even with the one you provide, so I guess that it comes from the runbot), I get a Odoo server error that I'm not able to check.

If you know how to see the runbot's logs then tell me and I will check what is causing this error, but it's not from me, the merge will just be safer.

@vaab
Copy link
Member

vaab commented Oct 14, 2015

Thanks for the PR. May I ask what you tested ok on Ooo v8 if you couldn't get a working example ? A excerpt from the error could help, I can't remember if you can get it in the JSON answer from the server.

The runbot logs are available easily on the each instances in the buttons provided next to the live test button.

Anyway, I'll look into this next week. There are probably ways to probe the server for the correct format. And I can't remember if in 7.0 this argument was required, so maybe this could be tested also.

@natinusala
Copy link
Author

I was only able to test the login method, which works fine for both Odoo 8 and 7.

I'll check the logs and see what is the issue with the example. I confirm that the session_id attribute is not required for the login in Odoo 7, but we need it to make more calls. Maybe removing it completely from the login method will work.

I also wanted to make a more clean way to do it, for example by probing Odoo as you said, but I currently don't know if there is a method to do it, with or without being authenticated. But since the authentication seems to work without the session_id even with Odoo 7, it may be better to first authenticate then detect the Odoo version and adapt regarding the result, thus removing the legacy parameter.

@natinusala
Copy link
Author

Okay, I figured that we can use the web/webclient/version_info RPC entry point to get the Odoo version. I'll see how to use this and update my code.

@natinusala
Copy link
Author

The automated legacy mode is working, however I've still an Odoo server error on 7.0 runbots that I can't check. The logs on the runbot page are only containing INFO logs regardless of what filter I choose. The 8.0 is working fine tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants