問題 ebay connector with OpenERP6.1
-
請叫各位兩點
1) 我想把ebay connector 模組加到openERP6.1
但是都會出現以下錯誤 有人知道怎麼修正嗎? 還是有哪位大大把這module修正成6.1版本了嗎
您的 OpenERP 版本没有包含支持。支持与维护服务在此处可以购买:模型”%s“的字段.
OpenERP Server Error
Client Traceback (most recent call last):
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 180, in dispatch
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 1004, in call_button
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 948, in call_common
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\controllers\main.py", line 962, in call_kw
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 250, in proxy
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 611, in send
Server Traceback (most recent call last):
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\web\common\http.py", line 592, in send
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\netsvc.py", line 360, in dispatch_rpc
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\service\web_services.py", line 572, in dispatch
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 167, in execute_kw
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 121, in wrapper
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 176, in execute
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\osv\osv.py", line 164, in execute_cr
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\base\module\module.py", line 359, in button_immediate_install
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\pooler.py", line 39, in restart_pool
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\registry.py", line 160, in new
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\loading.py", line 338, in load_modules
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\loading.py", line 253, in load_marked_modules
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\loading.py", line 165, in load_module_graph
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\module.py", line 409, in load_openerp_module
File "C:\Program Files\OpenERP 6.1-1\server.\openerp\modules\module.py", line 139, in load_module
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\ebay_connector_init.py", line 19, in <module>
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\ebay_connector\category.py", line 23, in <module>
File "C:\Program Files\OpenERP 6.1-1\server\openerp\addons\ebay_connector\ebayerp_osv.py", line 3168, in <module>
AttributeError: 'module' object has no attribute 'external_osv'
2) 我要另外加 ecommerce module 也是套入失敗,
看了許多 module似乎都有支援6.0板但不一定支援6.1,
我是不是該脆用6.0板比較好....XD -
我是用6.0.3版本的,安装是成功的,但是配置后,点一个按钮就报错。
报错问题是类似编码问题:
附上报错代码:<br />Traceback (most recent call last):<br /> File "/opt/openerp/server/bin/netsvc.py", line 489, in dispatch<br /> result = ExportService.getService(service_name).dispatch(method, auth, params)<br /> File "/opt/openerp/server/bin/service/web_services.py", line 599, in dispatch<br /> res = fn(db, uid, *params)<br /> File "/opt/openerp/server/bin/osv/osv.py", line 122, in wrapper<br /> return f(self, dbname, *args, **kwargs)<br /> File "/opt/openerp/server/bin/osv/osv.py", line 176, in execute<br /> res = self.execute_cr(cr, uid, obj, method, *args, **kw)<br /> File "/opt/openerp/server/bin/osv/osv.py", line 167, in execute_cr<br /> return getattr(object, method)(cr, uid, *args, **kw)<br /> File "/opt/openerp/server/bin/addons/eBay_Connector/template.py", line 750, in import_orders<br /> results = self.call(cr, uid, inst_lnk, 'GetSellerTransactions',currentTimeFrom,currentTimeTo,pageNumber,siteid)<br /> File "/opt/openerp/server/bin/addons/eBay_Connector/ebayerp_osv.py", line 3204, in call<br /> result = gSellerTrans.Get(arguments[0],arguments[1],arguments[2],arguments[3])<br /> File "/opt/openerp/server/bin/addons/eBay_Connector/ebayerp_osv.py", line 523, in Get<br /> responseDOM = api.MakeCall("GetSellerTransactions")<br /> File "/opt/openerp/server/bin/addons/eBay_Connector/ebayerp_osv.py", line 57, in MakeCall<br /> conn.request("POST", self.Session.Command, self.RequestData, self.GenerateHeaders(self.Session, CallName))<br /> File "/usr/lib/python2.7/httplib.py", line 955, in request<br /> self._send_request(method, url, body, headers)<br /> File "/usr/lib/python2.7/httplib.py", line 989, in _send_request<br /> self.endheaders(body)<br /> File "/usr/lib/python2.7/httplib.py", line 951, in endheaders<br /> self._send_output(message_body)<br /> File "/usr/lib/python2.7/httplib.py", line 809, in _send_output<br /> msg += message_body<br />UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1377: ordinal not in range(128)<br />
神奇的是我一步步调试下来,并没有什么ascii的编码格式。
有没有人玩过这个组件的,一起来讨论下。 -
不太神奇的是,Python的默认的编码就是:ASCII
当unicode decoding 时,如果未给字符串指定编码,就会用ASCII解码,而如果该字符串是用其他编码encode的,就会报decode错误。
比如你的例子中:在unicode和string做连接(concatenate)时(python 2.x下),string需要转换为unicode
msg = u'中文unicode'
message_body = '中文string'
msg += message_body
就会出decode错误,因为python会用ASCII来解码'中文string', 这是无法完成的。 -
不过我用的帐套中是没有任何中文的,难道默认也会发生这些问题?
那如果我用
sys.setdefaultencoding(‘utf-8’)
是不是就有用呢? -
不一定是中文,比如latin1编码的字符串用ASCII解码也会出现解码错误。
sys.setdefaultencoding('utf-8')并不真的能解决问题。而且sys.setdefaultencoding在site.py中已经被删除,我们不能直接使用。一定要使用,要么修改site.py, 要么在sitecustomize.py 文件中调用。这样虽然似乎能解决大多数的问题,但是在你的python环境中跑得正常的程序却不一定在别人的机器上正常运行。
所以,建议还是搞清字串编码,显式的做字串的编,解码 -
谢谢大大的回复,看来python的编码真的是长征第一步啊。