Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I used guide available for Multiprocessing in openerp-connector.
I created a bash file as start_connector and it contains
PYTHONPATH=/opt/openerp/v7.0/server connector/openerp-connector-worker --config /etc/openerp-server.conf --workers=2 --logfile=/tmp/openerp-connector.log
and I tried to start this file using this command
File "/usr/lib/python2.7/threading.py", line 808, in __bootstrap_inner
File "/opt/openerp/v7.0/custom_modules/launchpad_links/connector/queue/worker.py", line 304, in run
File "/opt/openerp/v7.0/custom_modules/launchpad_links/connector/queue/worker.py", line 317, in check_alive
File "/opt/openerp/v7.0/custom_modules/launchpad_links/connector/queue/worker.py", line 325, in _notify_alive
dbworker_obj = session.pool.get('queue.worker')
File "/opt/openerp/v7.0/custom_modules/launchpad_links/connector/session.py", line 128, in pool
self._pool = openerp.pooler.get_pool(self.cr.dbname)
File "/opt/openerp/v7.0/server/openerp/pooler.py", line 49, in get_pool
return get_db_and_pool(db_name, force_demo, status, update_module)
File "/opt/openerp/v7.0/server/openerp/pooler.py", line 33, in get_db_and_pool
registry = RegistryManager.get(db_name, force_demo, status, update_module)
File "/opt/openerp/v7.0/server/openerp/modules/registry.py", line 193, in get
File "/opt/openerp/v7.0/server/openerp/modules/registry.py", line 219, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/opt/openerp/v7.0/server/openerp/modules/loading.py", line 350, in load_modules
force, status, report, loaded_modules, update_module)
File "/opt/openerp/v7.0/server/openerp/modules/loading.py", line 256, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/opt/openerp/v7.0/server/openerp/modules/loading.py", line 159, in load_module_graph
File "/opt/openerp/v7.0/server/openerp/modules/module.py", line 415, in load_openerp_module
getattr(sys.modules['openerp.addons.' + module_name], info['post_load'])()
File "/opt/openerp/v7.0/web/addons/web/http.py", line 628, in wsgi_postload
File "/opt/openerp/v7.0/web/addons/web/http.py", line 517, in __init__
File "/opt/openerp/v7.0/web/addons/web/http.py", line 580, in load_addons
m = __import__('openerp.addons.' + module)
File "/opt/openerp/v7.0/server/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/opt/openerp/v7.0/custom_modules/launchpad_links/prestashoperpconnect/__init__.py", line 27, in <module>
File "/opt/openerp/v7.0/custom_modules/launchpad_links/prestashoperpconnect/prestashop_model.py", line 36, in <module>
from .unit.import_synchronizer import (
File "/opt/openerp/v7.0/custom_modules/launchpad_links/prestashoperpconnect/unit/__init__.py", line 26, in <module>
File "/opt/openerp/v7.0/custom_modules/launchpad_links/prestashoperpconnect/unit/mapper.py", line 35, in <module>
from backend_adapter import GenericAdapter
File "/opt/openerp/v7.0/custom_modules/launchpad_links/prestashoperpconnect/unit/backend_adapter.py", line 29, in <module>
from prestapyt import PrestaShopWebServiceDict
File "/usr/local/lib/python2.7/dist-packages/prestapyt-0.4.0-py2.7.egg/prestapyt/__init__.py", line 1, in <module>
from prestapyt import PrestaShopWebService
File "/usr/local/lib/python2.7/dist-packages/prestapyt-0.4.0-py2.7.egg/prestapyt/prestapyt.py", line 21, in <module>
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 52, in <module>
from . import utils
File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 22, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/local/lib/python2.7/dist-packages/requests/compat.py", line 95, in <module>
from .packages import chardet
File "/usr/local/lib/python2.7/dist-packages/requests/packages/__init__.py", line 3, in <module>
from . import urllib3
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/__init__.py", line 16, in <module>
from .connectionpool import (
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 20, in <module>
from queue import LifoQueue, Empty, Full
File "/opt/openerp/v7.0/custom_modules/launchpad/openerp-connector/connector/queue/__init__.py", line 22, in <module>
File "/opt/openerp/v7.0/custom_modules/launchpad/openerp-connector/connector/queue/model.py", line 30, in <module>
from .job import STATES, DONE, PENDING, OpenERPJobStorage
File "/opt/openerp/v7.0/custom_modules/launchpad/openerp-connector/connector/queue/job.py", line 33, in <module>
from ..exception import (NotReadableJobError,
ValueError: Attempted relative import beyond toplevel package
Where am I wrong?
or Is there a better method of launching in multi-worker mode for connector?
PYTHON RELATIVE IMPORT ERROR (Google PEP328).
This mean that the file exception.py can't be found.
NB: Try first to check if your addons custom-modules (/opt/openerp/v7.0/custom_modules/launchpad/openerp-connector) is in the addon_path of your openerp-server.conf, add it if not.
This error is due to your installation path !
You can edit your .....opt/openerp/v7.0/custom_modules/launchpad/openerp-connector/connector/queue/job.py file at line 34:
and give the right path to the file exception.py: from the-full-path-to-the-connector-module.connector.exception import ............
Like in: from openerp.addons.connector.exception import .........
This also can be corrected in /queue/__init__.py by importing the /connector/exception.py package
The BEST WAY to avoid this kind of errors is to use an ABSOLUTE IMPORT
It seems that urllib3/connectionpool.py (line 20) imports stuff from "queue", which most certainly shouldn't be the "queue" package in the connector odoo module.
Changing the "queue" package name under connector seems to work, but it's still a bit hacky. This could also be an import priority issue.
When I looked into the community mailing list, there were 2 messages that had similar topic of Multi worker Support
But there seems to be no other useful leads to solve this problem.
You can try Magento openerp connector provide by webkul : https://store.webkul.com/Magento-Extensions/Magento-OpenERP-Bridge.html
Their code don't base on worker concept but using core observer pattern of mangeto
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 platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/10/14, 6:47 AM|
|Seen: 4407 times|
|Last updated: 12/28/15, 5:13 PM|