Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    问题:ebay connector模块中libxml2.parseDoc()方法不存在?

    Odoo 新手求助
    2
    4
    3627
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xmroger last edited by

      最近印度公司把ebay connector开源了,但是使用起来会有一些问题,其中包括在下载ebay产品模板规格的时候对得到的xml字符串进行解释时会出错

      category.py中的第1119行
                                  catalog_en = results.get('CatalogEnabled',False)
                                  if catalog_en == 'true' :
                                      cr.execute("UPDATE category_master SET  catlog_enabled='True' where id=%s"%(ids[0]))
                                  cr.execute("UPDATE category_master SET attribute_set_id=%s where id=%s"%(results.get('AttributeSetID',False),ids[0]))
                                  attribute_set_id = self.browse(cr,uid,ids[0]).attribute_set_id
                                  attribute = self.pool.get('sale.shop').call(cr, uid, inst_lnk, 'GetAttributesCS',attribute_set_id,siteid)[color=red](1119行)          doc = libxml2.parseDoc(attribute)[/color]
      报错信息:
      Environment Information :
      System : Windows-32bit
      OS Name : nt
      Operating System Release :
      Operating System Version : 32bit
      Operating System Architecture : 32bit
      Operating System Locale : zh_CN.cp936
      Python Version : 2.5.2
      OpenERP-Client Version : 6.0.3
      Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
        File "E:\Devspace\OE6\server\bin\netsvc.py", line 489, in dispatch
          result = ExportService.getService(service_name).dispatch(method, auth, params)
        File "E:\Devspace\OE6\server\bin\service\web_services.py", line 599, in dispatch
          res = fn(db, uid, *params)
        File "E:\Devspace\OE6\server\bin\osv\osv.py", line 122, in wrapper
          return f(self, dbname, *args, **kwargs)
        File "E:\Devspace\OE6\server\bin\osv\osv.py", line 176, in execute
          res = self.execute_cr(cr, uid, obj, method, *args, **kw)
        File "E:\Devspace\OE6\server\bin\osv\osv.py", line 167, in execute_cr
          return getattr(object, method)(cr, uid, *args, **kw)
        File "E:\Devspace\OE6\server\bin\addons\eBay_Connector\category.py", line 1119, in get_attribute
          doc = libxml2.parseDoc(attribute)
      [color=red]AttributeError: 'module' object has no attribute 'parseDoc'[/color]

      在ebay connector中已经自带了libxml2目录,里面有libxml2 python binding的程序及c语言的底层执行程序。在eclipse中,libxml2.后面也会自动查询出parseDoc(cur)这个方法。实在搞不明白运行时为什么会报找不到libxml2.parseDoc这个方法的错误。

      希望以上的错误描述足够明确,也希望有人能帮忙解决这个问题。谢谢!

      1 Reply Last reply Reply Quote 0
      • digitalsatori
        digitalsatori 管理员 last edited by

        可能就是那个自带的libxml2的问题,如果你已安装了libxml库和他的python binding,那么就可以删除那个文件夹,测试办法,运行python, 输入import libxml2,如果没有出错信息,那说明libxml2模块已正常安装。
        如果要使用它打包的libxml2模块,应该在category.py模块的开始,将import libxml2改为from libxml2 import libxml2 试试

        【上海先安科技】(tony AT openerp.cn)

        1 Reply Last reply Reply Quote 0
        • X
          xmroger last edited by

          digitalsatori, 我爱死你了,用你的建议就成功解决问题了,谢谢啦!!!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post