0k / php-oe-json

OpenERP JSON-RPC lib for PHP
12 stars 24 forks source link

Fails with unexpected keyword argument 'session_id' in latest openerp (trunk, ~8.0) #2

Open vaab opened 10 years ago

vaab commented 10 years ago

Here's the full python (server side exception):

Traceback (most recent call last):
  File "/home/vaab/devel/python/0k-oe/openobject-server/openerp/http.py", line 321, in dispatch
    response["result"] = self._call_function(**self.params)
  File "/home/vaab/devel/python/0k-oe/openobject-server/openerp/http.py", line 195, in _call_function
    return self.func(*args, **kwargs)
TypeError: authenticate() got an unexpected keyword argument 'session_id'

Removing the session_id from authenticate params will produce then a second similar exception:

Traceback (most recent call last):
  File "/home/vaab/devel/python/0k-oe/openobject-server/openerp/http.py", line 321, in dispatch
    response["result"] = self._call_function(**self.params)
  File "/home/vaab/devel/python/0k-oe/openobject-server/openerp/http.py", line 194, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/vaab/devel/python/0k-oe/openobject-server/openerp/service/model.py", line 111, in wrapper
   return f(dbname, *args, **kwargs)
  File "/home/vaab/devel/python/0k-oe/openobject-server/openerp/http.py", line 189, in checked_call
    return self.func(*a, **kw)
TypeError: search_read() got an unexpected keyword argument 'session_id'

So it seems the API changed in the ~8.0 series of OpenERP.

dakermit commented 9 years ago

Hello, I am stumbling upon the same error using the 8.0 series of OpenERP. Any leads towards a solution anyone?

many thanks

vaab commented 9 years ago

Ok, just bumped into the same issue with some python lib I'm working on. On version 7.0, you had to provide a session_id which was used to identify the session, despite already having another 'Cookie' value that hold another session_id.

Simply removing the session_id from the arguments should suffice (but then you'll be incompatible with version 7.0, with a message stating that it can't find your database, as the database info are retrieved thanks to the session id.)

Do you need me to provide a patch ? I might not have any time soon. But a PR would be welcomed.