Comments (11)
I used an external lib in Java that we are supporting https://github.com/DeBortoliWines/openerp-java-api and try to connect to a db with wishlist module
from e-commerce.
Same issue with the default python xml-rpc api:
import xmlrpclib
# Database and openerp settings:
username = "admin"
pwd = "admin"
dbname = "test"
oeserver = "http://odoo-server"
print "connecting to odoo"
sock_common = xmlrpclib.ServerProxy(oeserver +"/xmlrpc/common")
print "Do a login"
uid = sock_common.login(dbname, username, pwd)
print "uid found", uid
sock = xmlrpclib.ServerProxy(oeserver + "/xmlrpc/object")
And the traceback from this script:
connecting to odoo
Do a login
Traceback (most recent call last):
File "connect.py", line 13, in <module>
uid = sock_common.login(dbname, username, pwd)
File "/usr/lib/python2.7/xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.7/xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "/usr/lib/python2.7/xmlrpclib.py", line 1283, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python2.7/xmlrpclib.py", line 1316, in single_request
return self.parse_response(response)
File "/usr/lib/python2.7/xmlrpclib.py", line 1493, in parse_response
return u.close()
File "/usr/lib/python2.7/xmlrpclib.py", line 800, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault object unbound: 'Traceback (most recent call last):
File "/opt/odoo/test/odoo/odoo/service/wsgi_server.py", line 56, in xmlrpc_return
result = odoo.http.dispatch_rpc(service, method, params)
File "/opt/odoo/test/odoo/odoo/http.py", line 118, in dispatch_rpc
result = dispatch(method, params)
File "/opt/odoo/test/odoo/odoo/service/common.py", line 57, in dispatch
return g[exp_method_name](*params)
File "/opt/odoo/test/odoo/odoo/service/common.py", line 23, in exp_login
res = security.login(db, login, password)
File "/opt/odoo/test/odoo/odoo/service/security.py", line 9, in login
return res_users._login(db, login, password)
File "/opt/odoo/test/odoo/odoo/addons/base/res/res_users.py", line 455, in _login
user.sudo(user_id).check_credentials(password)
File "/opt/odoo/test/website_sale_wishlist/models/res_users.py", line 27, in check_credentials
self.env["product.wishlist"]._join_current_user_and_session()
File "/opt/odoo/test/website_sale_wishlist/models/product_wishlist.py", line 71, in _join_current_user_and_session
("session", "=", request.session.sid),
File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 338, in __getattr__
return getattr(self._get_current_object(), name)
File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 297, in _get_current_object
return self.__local()
File "/usr/lib/python2.7/dist-packages/werkzeug/local.py", line 132, in _lookup
raise RuntimeError(\'object unbound\')
RuntimeError: object unbound
'>
from e-commerce.
Hi @flotho - What are you attempting to do in the API that triggers this error? Are you able to reproduce on Runbot?
from e-commerce.
@lasley @flotho Is there any update on this issue ? I am facing the same one.
from e-commerce.
@py-prak - no, because we do not have proper information to diagnose.
If you could please provide some replication steps, that would be great. Otherwise, I propose that a PSC close this issue due to lack of information and response.
from e-commerce.
Hi @lasley
I reproduced the same error on runbot :
Traceback (most recent call last):
File "/.repo_requirements/odoo/openerp/service/wsgi_server.py", line 56, in xmlrpc_return
result = openerp.http.dispatch_rpc(service, method, params)
File "/.repo_requirements/odoo/openerp/http.py", line 115, in dispatch_rpc
result = dispatch(method, params)
File "/.repo_requirements/odoo/openerp/service/common.py", line 57, in dispatch
return g[exp_method_name](*params)
File "/.repo_requirements/odoo/openerp/service/common.py", line 23, in exp_login
res = security.login(db, login, password)
File "/.repo_requirements/odoo/openerp/service/security.py", line 9, in login
return res_users._login(db, login, password)
File "/.repo_requirements/odoo/openerp/addons/base/res/res_users.py", line 462, in _login
self.check_credentials(cr, user_id, password)
File "/.repo_requirements/odoo/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/.repo_requirements/odoo/openerp/api.py", line 354, in old_api
result = method(recs, *args, **kwargs)
File "/home/odoo/build/OCA/e-commerce/website_sale_wishlist/models/res_users.py", line 27, in check_credentials
self.env["product.wishlist"]._join_current_user_and_session()
File "/.repo_requirements/odoo/openerp/api.py", line 248, in wrapper
return new_api(self, *args, **kwargs)
File "/home/odoo/build/OCA/e-commerce/website_sale_wishlist/models/product_wishlist.py", line 72, in _join_current_user_and_session
("session", "=", request.session.sid),
File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 338, in __getattr__
return getattr(self._get_current_object(), name)
File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 297, in _get_current_object
return self.__local()
File "/usr/local/lib/python2.7/dist-packages/werkzeug/local.py", line 132, in _lookup
raise RuntimeError('object unbound')
RuntimeError: object unbound
Database used :
9.0 : http://3294646-9-0-05c08c.runbot1.odoo-community.org/
10.0 : http://3296172-10-0-6f996a.runbot2.odoo-community.org
Same issue
from e-commerce.
@flotho - Thanks for the test case. It seems interesting to me that the request session is not set during an API interaction. cc @yajo
from e-commerce.
@lasley , you're welcome,
from e-commerce.
What steps did you follow to get to the error?
from e-commerce.
Yeah, the problem's clear: we should check the existence of the session before attempting to use it.
from e-commerce.
Triaging.
from e-commerce.
Related Issues (20)
- Variant error when module is installed. HOT 3
- [16.0] website_sale_hide_price - Show price in comparison tool and wishlist HOT 1
- Migration to version 17.0 HOT 6
- Website_sale_hide_price get an error when updating from 16.0.1.2.1 to 16.0.1.3.0 HOT 1
- Update website_sale_payment_term_acquirer to version 16/17 HOT 1
- Organize the pack of modules by industry (versus customer segments) HOT 1
- Implement this organization in Github HOT 1
- Listing the dependencies HOT 2
- [16.0] website_sale_checkout_skip_payment not installing HOT 3
- new feature: zoom on hover over product HOT 1
- website_sale_infinite_scroll disable "Add to cart" button
- [12.0] website_sale_secondary_unit: product quantity isn't calculated with float factor
- website_sale_checkout_skip_payment Problem not able to create second quotation
- error installing module on newest R17 (odoo.sh)
- [16.0][website_sale_stock_list_preview] UncaughtPromiseError after upgrading to latest odoo revision
- Error during instalation on server [Odoo15] HOT 2
- Hide prices on website level NOT working
- Error en filtros modulo website_sale_hide_price V.17 HOT 1
- [17] product_visibility_website won't install on Odoo 17 HOT 1
- Updating website_sale_hide_price from 1.4.0 to 2.0.0 get an error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from e-commerce.