新人贴:有哪位大侠成功安装OpenLabs的magento integration模块呀(已解决)
-
一直想整合Magento与Openerp7, 发现只有三家Connectors, 一个是openlabs的 magento_integration, 另一个是Camptocamp的magentoerpconnector,还有一个是WebKul的magneto-openerp-bridge(支持odoo8但功能少)
最后还有一个是Saas的odooconnetor(按订单收费-贵)。
所以前两个是最好的解决方案了,尝试安装openlabs或Camptocamp N多次了,都未能成功,google也找不到答案,恳求论坛里的大大们指条明路。
安装到最后出现如下截图,并附上log:
openerp@ubuntu:/opt/odoo$ ./openerp-server
2015-01-29 18:09:58,537 4065 INFO ? openerp: OpenERP version 7.0-20150123
2015-01-29 18:09:58,537 4065 INFO ? openerp: addons paths: /opt/odoo/openerp/addons
2015-01-29 18:09:58,537 4065 INFO ? openerp: database hostname: localhost
2015-01-29 18:09:58,537 4065 INFO ? openerp: database port: 5432
2015-01-29 18:09:58,537 4065 INFO ? openerp: database user: openerp
2015-01-29 18:09:58,695 4065 INFO ? openerp.addons.google_docs.google_docs: GData lib version%s GData-Python/2.0.18
detected
2015-01-29 18:09:59,167 4065 INFO ? openerp.service.wsgi_server: HTTP service (werkzeug) running on 0.0.0.0:8069
2015-01-29 18:09:59,168 4065 INFO ? openerp: OpenERP server is running, waiting for connections...
2015-01-29 18:10:16,830 4065 INFO odoo2 openerp.modules.loading: loading 1 modules...
2015-01-29 18:10:16,849 4065 INFO odoo2 openerp.modules.loading: loading 55 modules...
2015-01-29 18:10:17,009 4065 INFO odoo2 openerp.modules.loading: Modules loaded.
2015-01-29 18:10:17,022 4065 INFO odoo2 werkzeug: 127.0.0.1 - - [29/Jan/2015 18:10:17] "POST /web/action/load HTTP/1.1" 200 -
2015-01-29 18:10:17,045 4065 INFO odoo2 werkzeug: 127.0.0.1 - - [29/Jan/2015 18:10:17] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2015-01-29 18:10:17,099 4065 INFO odoo2 werkzeug: 127.0.0.1 - - [29/Jan/2015 18:10:17] "POST /web/dataset/call_kw HTTP/1.1" 200 -
2015-01-29 18:10:21,929 4065 INFO odoo2 openerp.modules.loading: loading 1 modules...
2015-01-29 18:10:21,947 4065 INFO odoo2 openerp.modules.loading: loading 55 modules...
2015-01-29 18:10:22,074 4065 INFO odoo2 openerp.modules.loading: loading 56 modules...
2015-01-29 18:10:22,081 4065 INFO odoo2 openerp.modules.module: module magento_integration: creating or updating database tables
2015-01-29 18:10:22,155 4065 ERROR odoo2 openerp.sql_db: bad query: ALTER TABLE "product_product" ADD CONSTRAINT "product_product_uniq_default_code" unique(default_code)
Traceback (most recent call last):
File "/opt/odoo/openerp/sql_db.py", line 226, in execute
res = self._obj.execute(query, params)
IntegrityError: could not create unique index "product_product_uniq_default_code"
DETAIL: Key (default_code)=(/) is duplicated.
2015-01-29 18:10:22,156 4065 WARNING odoo2 openerp.osv.orm.schema: Table 'product_product': unable to add 'unique(default_code)' constraint !
If you want to have it, you should update the records and execute manually:
ALTER TABLE "product_product" ADD CONSTRAINT "product_product_uniq_default_code" unique(default_code)
2015-01-29 18:10:22,376 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/test_connection.xml
2015-01-29 18:10:22,393 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/import_websites.xml
2015-01-29 18:10:22,402 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/import_catalog.xml
2015-01-29 18:10:22,411 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/update_catalog.xml
2015-01-29 18:10:22,421 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/import_orders.xml
2015-01-29 18:10:22,430 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/export_orders.xml
2015-01-29 18:10:22,439 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/import_carriers.xml
2015-01-29 18:10:22,462 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/export_inventory.xml
2015-01-29 18:10:22,471 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/export_tier_prices.xml
2015-01-29 18:10:22,536 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/export_shipment_status.xml
2015-01-29 18:10:22,557 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading wizard/export_catalog.xml
2015-01-29 18:10:22,590 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading product.xml
2015-01-29 18:10:22,747 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading magento.xml
2015-01-29 18:10:22,881 4065 INFO odoo2 openerp.modules.loading: module magento_integration: loading sale.xml
2015-01-29 18:10:22,891 4065 ERROR odoo2 openerp.addons.base.ir.ir_ui_view: Can't render view for model: sale.order
Traceback (most recent call last):
File "/opt/odoo/openerp/addons/base/ir/ir_ui_view.py", line 126, in _check_render_view
fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
File "/opt/odoo/openerp/osv/orm.py", line 2279, in fields_view_get
arch=apply_view_inheritance(cr, user, source, sql_res['id']),
File "/opt/odoo/openerp/osv/orm.py", line 2237, in apply_view_inheritance
source = apply_inheritance_specs(source, view_arch, view_id)
File "/opt/odoo/openerp/osv/orm.py", line 2221, in apply_inheritance_specs
raise_view_error("Element '%s' not found in parent view '%%(parent_xml_id)s'" % tag, inherit_id)
File "/opt/odoo/openerp/osv/orm.py", line 2114, in raise_view_error
% (child_view.xml_id, self._name, error_msg))
AttributeError: View definition error for inherited view 'base_sale_multichannels.base_sale_multichannel_view_order_form' on model 'sale.order': Element '<xpath expr="//field[@name='order_line']/form/field[@name='name']">' not found in parent view 'sale.view_order_form'
2015-01-29 18:10:22,895 4065 ERROR odoo2 openerp.tools.convert: Parse error in /opt/odoo/openerp/addons/magento_integration/sale.xml:5:
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<data><xpath expr="//form[@string='Sales Order Lines']/field[@name='name']" position="after">
<group>
<group colspan="1">
<field name="name"/>
</group>
<group colspan="1">
<field name="magento_notes"/>
</group>
</group>
</xpath>
<xpath expr="//form[@string='Sales Order Lines']/label[@for='name']" position="replace"/>
<xpath expr="//form[@string='Sales Order Lines']/field[@name='name']" position="replace"/>
</data></field>
</record>
Traceback (most recent call last):
File "/opt/odoo/openerp/tools/convert.py", line 852, in parse
self._tags[rec.tag](self.cr, rec, n)
File "/opt/odoo/openerp/tools/convert.py", line 819, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 983, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/opt/odoo/openerp/addons/base/ir/ir_ui_view.py", line 103, in create
return super(view, self).create(cr, uid, values, context)
File "/opt/odoo/openerp/osv/orm.py", line 4607, in create
self._validate(cr, user, [id_new], context)
File "/opt/odoo/openerp/osv/orm.py", line 1588, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2015-01-29 18:10:22,896 4065 ERROR odoo2 openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
Traceback (most recent call last):
File "/opt/odoo/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/odoo/openerp/service/web_services.py", line 632, in dispatch
res = fn(db, uid, *params)
File "/opt/odoo/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/opt/odoo/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/opt/odoo/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/opt/odoo/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/opt/odoo/openerp/addons/base/module/module.py", line 426, in button_immediate_install
return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)
File "/opt/odoo/openerp/addons/base/module/module.py", line 473, in button_immediate_function
, pool = pooler.restart_pool(cr.dbname, update_module=True)
File "/opt/odoo/openerp/pooler.py", line 39, in restart_pool
registry = RegistryManager.new(db_name, force_demo, status, update_module)
File "/opt/odoo/openerp/modules/registry.py", line 233, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/opt/odoo/openerp/modules/loading.py", line 355, in load_modules
loaded_modules, update_module)
File "/opt/odoo/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/odoo/openerp/modules/loading.py", line 188, in load_module_graph
load_data(module_name, idref, mode)
File "/opt/odoo/openerp/modules/loading.py", line 76, in <lambda>
load_data = lambda *args: _load_data(cr, *args, kind='data')
File "/opt/odoo/openerp/modules/loading.py", line 124, in _load_data
tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
File "/opt/odoo/openerp/tools/convert.py", line 959, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo/openerp/tools/convert.py", line 852, in parse
self._tags[rec.tag](self.cr, rec, n)
File "/opt/odoo/openerp/tools/convert.py", line 819, in _tag_record
id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 983, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/opt/odoo/openerp/addons/base/ir/ir_ui_view.py", line 103, in create
return super(view, self).create(cr, uid, values, context)
File "/opt/odoo/openerp/osv/orm.py", line 4607, in create
self._validate(cr, user, [id_new], context)
File "/opt/odoo/openerp/osv/orm.py", line 1588, in _validate
raise except_orm('ValidateError', '\n'.join(error_msgs))
except_osv: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2015-01-29 18:10:22,898 4065 INFO odoo2 werkzeug: 127.0.0.1 - - [29/Jan/2015 18:10:22] "POST /web/dataset/call_button HTTP/1.1" 200 - -
openlabs的解决方案已解决, 原来要添加magento和pycountry到python库里就可以了哈!谢谢‘保定-粉刷匠’的手册。
Camptocamp的也成功安装了, 需要把须要的库安装到正确路径,还要把addons的正确路径写进openerp-server.conf里。比如:
addons_path = /openerp/addons,/openerp/addons/connector,/openerp/addons/connector-ecommerce,/openerp/addons/connector-magento,/openerp/addons/e-commerce,/openerp/addons/product-attribute,/openerp/addons/sale-workflow -
按照楼主描述尝试做了安装测试,最后按照按照下述文档完成Odoo7.0与Magento(1.9 并导入演示数据)的整合,测试通过. 小结如下,给后来的小伙伴,可以少走些弯路.
Welcome to Magento OpenERP Integration’s documentation!
https://openerp-magento-connector.readthedocs.org/en/develop/index.html
Contents:
Introduction
Installation
Configuration
Magento Instance
Magento Website
Website Store
Store View
Create Sale Orders in Magento
How it Works
Orders are imported as Sales
Cancellation Of Sale Order
Exporting Order Status from OpenERP to Magento
Handle Taxes When Importing Orders From Magento
Handle Taxes On Shipping
About Openlabs Technologies and Consulting Private Limited
Technical Support
按照上述链接步骤进行,需要安装pycountry,下面记录了些问题,可供参考.
1.Import Catalog 报错(bug): magento_instance_website 提示没有设置缺省UOM
解决:
update magento_instance_website set default_product_uom=1
默认计量单位 "件"
2.Import Orders 报错(bug):
1)Magento Store Madison Island should have a shop configured.
解决:
在Website Store >> 修改 Sales Shop
2)提示产品不存在, Magento 产品500多(1.9演示数据), 导入产品308,部分产品未导入
测试在Magento上新增订单(新建订单选项中的运费未选时不能保存.)
然后在Import Orders中设置导入时间限制
Last Export / Import Time
Last Order Import Time
04/01/2015 17:38:10
Last Order Export Time
04/01/2015 17:37:48
Last Shipment Export Time
04/01/2015 17:37:53
=>然后执行Import Orders 提示成功,一个订单导入.
Last Order Import Time 更新为:
04/06/2015 17:38:10 -
补充Odoo v8 与 Magento整合的情况
与 Odoo v7和Magento 整合基本过程一样,安装成功后,数据同步正常, 其中有些问题列在下面, 仅供参考.
1.
问题: Odoo v8 中sale中取消了res.shop, 如仍使用magento_integration目前的版本安装时会报错.
解决: 可将magento_integration的代码中res.shop直接替换为product.pricelist,从代码来看,与产品价格表有关,目前这个只是临时的处理方法,仅做测试.
安装设置过程与v7不同的,是在Import Orders 前在Website Store 中修改 Pricelist,然后执行导入.
2.
问题:执行Import Orders 报错,提示partner.py 225行错误,从分析来看,应该与客户地址相关
解决:将 for address in parent.child_ids + [parent]: 修改为for address in parent.child_ids: 这是临时解决,待改进,仅供测试.
3. 待改进: magento_integration目前的版本在到产品数据时,没有与Odoo v8中Product Variants 功能结合, 这方面需要改进.
顺便赞一下,@wangbuke 做的GreenOpenERP 绿色安装版,真心不错,这次测试过程很顺畅.
http://sourceforge.net/projects/greenopenerp/ -
依照xuxudodo的方式進行安裝,可是進行到在openerp內更新模塊時,無法找到該模塊,出現錯誤信息如下:
OpenERP Server Error
Client Traceback (most recent call last):
File "/var/packages/OpenERP7.x/target/openerp/addons/web/http.py", line 195, in dispatch
response["result"] = method(self, **self.params)
File "/var/packages/OpenERP7.x/target/openerp/addons/web/controllers/main.py", line 1083, in call_button
action = self._call_kw(req, model, method, args, {})
File "/var/packages/OpenERP7.x/target/openerp/addons/web/controllers/main.py", line 1071, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 43, in proxy
result = self.proxy.execute_kw(self.session._db, self.session.uid, self.session.password, self.model, method, args, kw)
File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 31, in proxy_method
result = self.session.send(self.service_name, method, *args)
File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 104, in send
raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)
Server Traceback (most recent call last):
File "/var/packages/OpenERP7.x/target/openerp/addons/web/session.py", line 90, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/usr/lib/python2.7/site-packages/openerp/netsvc.py", line 295, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/usr/lib/python2.7/site-packages/openerp/service/web_services.py", line 614, in dispatch
res = fn(db, uid, *params)
File "/usr/lib/python2.7/site-packages/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/usr/lib/python2.7/site-packages/openerp/osv/osv.py", line 131, in wrapper
return f(self, dbname, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp/osv/osv.py", line 198, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/usr/lib/python2.7/site-packages/openerp/osv/osv.py", line 185, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/var/packages/OpenERP7.x/target/openerp/addons/base/module/wizard/base_module_update.py", line 42, in update_module
update, add = module_obj.update_list(cr, uid,)
File "/var/packages/OpenERP7.x/target/openerp/addons/base/module/module.py", line 619, in update_list
handler.load_addons()
File "/var/packages/OpenERP7.x/target/openerp/addons/web/http.py", line 546, in load_addons
m = import('openerp.addons.' + module)
File "/usr/lib/python2.7/site-packages/openerp/modules/module.py", line 133, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/var/packages/OpenERP7.x/target/openerp/addons/magento_integration-develop/init.py", line 9, in <module>
import magento
File "/var/packages/OpenERP7.x/target/openerp/addons/magento_integration-develop/magento.py", line 17, in <module>
import magento
ImportError: No module named magento
最下面這個地方,導入時的錯誤,好像是說明了找不到這個名為magento的模塊。
這裡可以請各位大俠,為小弟解譯一下嗎?
樓上曾提到,按照上述链接步骤进行,需要安装pycountry,
這個pycounty是什麼東西呢?該怎麼樣進行安裝,小弟不才,可以麻煩說明一下嗎?