在odoo中安装woocommerce连接器

时间:2016-01-20 06:21:07

标签: wordpress python-2.7 woocommerce openerp

我想连接woocommerce和odoo。我在Odoo的woocommmerce连接器安装有问题。我从https://github.com/OCA/connector-woocommerce获得了woocommerce连接器。我已将此模块上传到odoo中的addons文件夹中。当我尝试更新odoo中的模块列表时,我收到此错误:

    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

2 个答案:

答案 0 :(得分:2)

您的系统似乎没有安装woocommerce REST api

使用您的终端安装woocommerce。这是命令

sudo pip install woocommerce

编辑:

在终端

中打开python提示符
$ 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

如果它显示没有名为woocommerce的模块意味着你在woocommerce上遇到了一些安装问题。

答案 1 :(得分:0)

我在odoo中安装woocommerce连接器时遇到了同样的问题。之后,我已经安装了

的woocommerce模块

pip install woocommerce。我正在使用Windows平台。

成功安装woocommerce python模块后,我遇到了同样的问题。

这里的问题是odoo没有在其附加文件夹中找到woocommerce。

解决方案就在这里:

  
      
  • 打开文件夹&#34; C:\ Python27 \ Lib \ site-packages&#34;。

  •   
  • 这是安装python模块的路径。从此文件夹中找到文件夹&#39; woocommerce&#39;。

  •   
  • 复制此文件夹并将其放在odoo服务器路径
  • 中   
  • &#34; D:\ Odoo 8.0-20160107 \ server&#34; 。
  •   
  • 现在重启odoo
  •   

希望这会对你有所帮助。