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

V8 : authentification JSON query has changed ? [SOLVED]

By
cd
on 2/14/14, 5:51 AM 2,869 views

I use a set of JSON-RPC queries.

With version 7, the process is okay : -i retrieve the cookie (name "sid")
-web/session/get_session_info
-web/session/authenticate (i send to OpenERP the username, the password, the cookie)

But with version 8, it seems to have changed -i retrieve the cookie (name has changed to "session_id")
-web/session/get_session_info
-but then no "web/session/authenticate"

My question is : how to manage the authentification process in JSON queries in version 8 ? The whole process has changed or I'm doing something wrong ?

How to send to OpenERP, via JSON-RPC, the username and password ?

After some work, here are the changes.

cd
on 2/15/14, 9:05 AM

web/session/authenticate,this address that i can not vist on V8, error info:OpenERPJSONRPCClientMethodNotFoundError: http://localhost:8069/web/session/authenticate is not a valid URL.

liuchang
on 6/3/14, 9:52 PM
3
cd
On 2/15/14, 9:09 AM

OK, my problem is solved.

Here are the changes, between version 7 and 8.

1-the name of the cookie
V7 = "sid"
V8 = "session_id"

2-in the JSON queries
V7 = need to put "session_id":"xxxxxxxxxxxxxxxxxxxxx"
V8 = no need

Example :
{"jsonrpc":"2.0","method":"call","params":{"model":"res.partner","fields":["name","ref","credit_limit","fax","sale_warn","sale_warn_msg","property_product_pricelist","property_payment_term","sale_order_count","phone","email","country_id"],"domain":[["customer","=",1],["is_company","=",1],["display_name","ilike","AGR"]],"context":{"lang":"fr_FR","tz":"Europe/Brussels","uid":1,"search_default_customer":1,"bin_size":true},"offset":0,"limit":80,"sort":"","session_id":"1bc3ee4bdbbf432f88b38313c4d35ae2"},"id":791668276}

3-the mechanism
V7=need to set the cookie, with the value (retrieved from the header) and not the session_id (sent by OpenERP, after authentification)
V8=both are identical

Last but not least : "web/session/authenticate" is working fine V8. I made a mistake.

what do you mean by: retrieved from the header ? do you think it's possible to associate the session_id with an URL so that tue user can connect automaticly to Openerp v7

feriel bendimerad
on 11/9/14, 9:22 AM
0
liuchang
On 6/3/14, 10:01 PM

v7:

server_response = requests.post('http://localhost:8069/web/session/get_session_info', json.dumps(post_data), cookies=self._cookies)

server_response.status_code=200

server_response.json() is no problem

v8:

server_response.status_code=500 

server_response.json() is error

 

what changes i do that make me can use server_response.json() in v8?

 

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: 2/14/14, 5:51 AM
Seen: 2869 times
Last updated: 3/16/15, 8:10 AM