installing woocommerce connector in odoo

2019-04-09 17:46发布

问题:

i want to connect woocommerce and odoo. i have problem with woocommmerce connector installation in Odoo. i got the woocommerce connector from https://github.com/OCA/connector-woocommerce . i have upload this module into addons folder in odoo.. When i tried to update the module list in odoo, i got this error:

    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 537, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception).
      File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 574, in dispatch
        result = self._call_function(**self.params)
      File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 310, in _call_function
        return checked_call(self.db, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/service/model.py", line 113, in wrapper
       return f(dbname, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 307, in checked_call
       return self.endpoint(*a, **kw)
    File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 803, in __call__
       return self.method(*args, **kw)
    File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 403, in response_wrap
       response = f(*args, **kw)
    File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 948, in call_button
       action = self._call_kw(model, method, args, {})
    File "/usr/lib/python2.7/dist-packages/openerp/addons/web/controllers/main.py", line 936, in _call_kw
       return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 241, in wrapper
       return old_api(self, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 393, in old_api
       result = new_api(recs, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 397, in new_api
       result = [method(rec, *args, **kwargs) for rec in self]
    File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/wizard/base_module_update.py", line 15, in update_module
       self.updated, self.added = self.env['ir.module.module'].update_list()
    File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 239, in wrapper
       return new_api(self, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/api.py", line 462, in new_api
       result = method(self._model, cr, uid, *args, **kwargs)
    File "/usr/lib/python2.7/dist-packages/openerp/addons/base/module/module.py", line 654, in update_list
       handler.load_addons()
    File "/usr/lib/python2.7/dist-packages/openerp/http.py", line 1308, in load_addons
       m = __import__('openerp.addons.' + module)
    File "/usr/lib/python2.7/dist-packages/openerp/modules/module.py", line 80, in load_module
       mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
    File "/usr/lib/python2.7/dist-packages/openerp/addons/connector_woocommerce/__init__.py", line 22, in <module>
       from . import model
    File "/usr/lib/python2.7/dist-packages/openerp/addons/connector_woocommerce/model/__init__.py", line 22, in <module>
       from . import backend
    File "/usr/lib/python2.7/dist-packages/openerp/addons/connector_woocommerce/model/backend.py", line 23, in <module>
       from woocommerce import API

    ImportError: No module named woocommerce

回答1:

It seems like you do not have installed woocommerce REST api on your system.

install woocommerce using your terminal. here is the command

sudo pip install woocommerce

EDIT:

Open python prompt in terminal

$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from woocommerce import API
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named woocommerce

If it says No module named woocommerce means you have some installation issue with woocommerce.



回答2:

I was facing same problem while installing woocommerce connector in odoo. After that i have installed woocommerce module by

pip install woocommerce. I was working on windows platform.

I was getting same problem after successfully installing woocommerce python module.

Here Problem is odoo is not finding woocommerce in it's addon folder.

So solution is here :

  • open folder "C:\Python27\Lib\site-packages".

  • This is the path where python modules are installed. From this folder find the folder 'woocommerce'.

  • copy this folder and put this in odoo server path which is
  • "D:\Odoo 8.0-20160107\server" .
  • Now restart odoo

Hope this will help you.