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

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

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

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

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

在XP中源码运行OpenERP70全过程记录


  • Banned

                        在XP中源码运行OpenERP70全过程记录
    1)用easy_install安装lxml时,要指定版本为2.2.2,即用命令“easy_install lxml==2.2.2”
    2)用easy_install安装好PIL后,在python中要执行“import Image”命令,而不是“import PIL”,另外源码image.py中去掉“import Image”前的“from PIL”
    3)提示缺少yaml时,使用“easy_install pyyaml”。
    4)提示缺少reportlab.platypus时,使用“easy_install pyyaml”
    5)用easy_install安装reportlab时,提示下载文件与MD5不符,采用直接下载Windows安装文件解决,地址:http://pypi.python.org/packages/2.6/r/reportlab/reportlab-2.5.win32-py2.6.exe。
    6)用easy_install安装pychart时,提示下载地址错误,从此处下载并用"python setup.py install".
    7)提示缺少workzeug.serving时,使用“easy_install pyyaml”,从此处下载,并用"python setup.py install".
    8)去掉了workers.py中的“import resource”
    9)提示缺少Openid时,安装“python-openid”
    10)提示缺少docultils-core时,安装“docultils”
    11)提示缺少“google”模块时,安装gdata,从此处下载,并用"python setup.py install".
    此时OpenERP的Server服务启动成功,从火狐能进入登录界面。
    但不能创建数据库。
    提示信息详见:
    OpenERP Server Error

    Client Traceback (most recent call last):
      File "D:\openerp70\openerp\addons\web\common\http.py", line 182, in dispatch
        response["result"] = method(controller, self, **self.params)
      File "D:\openerp70\openerp\addons\web\controllers\main.py", line 852, in authenticate
        req.session.authenticate(db, login, password, env)
      File "D:\openerp70\openerp\addons\web\common\session.py", line 123, in authenticate
        uid = self.proxy('common').authenticate(db, login, password, env)
      File "D:\openerp70\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
        result = self.connector.send(self.service_name, method, *args)
      File "D:\openerp70\openerp\addons\web\common\session.py", line 66, in send
        raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


    Server Traceback (most recent call last):
      File "D:\openerp70\openerp\addons\web\common\session.py", line 51, in send
        return openerp.netsvc.dispatch_rpc(service_name, method, args)
      File "D:\openerp70\openerp\netsvc.py", line 362, in dispatch_rpc
        result = ExportService.getService(service_name).dispatch(method, params)
      File "D:\openerp70\openerp\service\web_services.py", line 397, in dispatch
        return fn(*params)
      File "D:\openerp70\openerp\service\web_services.py", line 408, in exp_authenticate
        res_users = pooler.get_pool(db).get('res.users')
      File "D:\openerp70\openerp\pooler.py", line 50, in get_pool
        return get_db_and_pool(db_name, force_demo, status, update_module)[1]
      File "D:\openerp70\openerp\pooler.py", line 33, in get_db_and_pool
        registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
      File "D:\openerp70\openerp\modules\registry.py", line 154, in get
        update_module, pooljobs)
      File "D:\openerp70\openerp\modules\registry.py", line 176, in new
        openerp.modules.load_modules(registry.db, force_demo, status, update_module)
      File "D:\openerp70\openerp\modules\loading.py", line 289, in load_modules
        loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
      File "D:\openerp70\openerp\modules\loading.py", line 180, in load_module_graph
        load_data(module_name, idref, mode)
      File "D:\openerp70\openerp\modules\loading.py", line 78, in <lambda>
        load_data = lambda *args: _load_data(cr, *args, kind='data')
      File "D:\openerp70\openerp\modules\loading.py", line 125, in _load_data
        tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
      File "D:\openerp70\openerp\tools\convert.py", line 955, in convert_xml_import
        obj.parse(doc.getroot())
      File "D:\openerp70\openerp\tools\convert.py", line 848, in parse
        self._tags[rec.tag](self.cr, rec, n)
      File "D:\openerp70\openerp\tools\convert.py", line 815, 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 "D:\openerp70\openerp\addons\base\ir\ir_model.py", line 825, in _update
        res_id = model_obj.create(cr, uid, values, context=context)
      File "D:\openerp70\openerp\addons\base\res\res_partner.py", line 370, in create
        return super(res_partner,self).create(cr, uid, vals, context=context)
      File "D:\openerp70\openerp\osv\orm.py", line 4190, in create
        vals = self._add_missing_default_values(cr, user, vals, context)
      File "D:\openerp70\openerp\osv\orm.py", line 2413, in _add_missing_default_values
        defaults = self.default_get(cr, uid, missing_defaults, context)
      File "D:\openerp70\openerp\osv\orm.py", line 1509, in default_get
        defaults[f] = self._defaults[f](self, cr, uid, context)
      File "D:\openerp70\openerp\addons\base\res\res_partner.py", line 292, in <lambda>
        'image': lambda self, cr, uid, ctx: self._get_default_image(cr, uid, ctx.get('default_is_company', False), ctx),
      File "D:\openerp70\openerp\addons\base\res\res_partner.py", line 271, in _get_default_image
        return tools.image_resize_image_big(image.encode('base64'))
      File "D:\openerp70\openerp\tools\image.py", line 91, in image_resize_image_big
        return image_resize_image(base64_source, size, encoding, filetype, avoid_if_small)
      File "D:\openerp70\openerp\tools\image.py", line 66, in image_resize_image
        image = Image.open(image_stream)
      File "D:\Python26\lib\site-packages\pil-1.1.7-py2.6-win32.egg\Image.py", line 1980, in open
        raise IOError("cannot identify image file")
    IOError: cannot identify image file


    OE Sever启动提示为:
    OpenERP Server Error

    Client Traceback (most recent call last):
      File "D:\openerp70\openerp\addons\web\common\http.py", line 182, in dispatch
        response["result"] = method(controller, self, **self.params)
      File "D:\openerp70\openerp\addons\web\controllers\main.py", line 823, in authenticate
        req.session.authenticate(db, login, password, env)
      File "D:\openerp70\openerp\addons\web\common\session.py", line 123, in authenticate
        uid = self.proxy('common').authenticate(db, login, password, env)
      File "D:\openerp70\openerp\addons\web\common\openerplib\main.py", line 117, in proxy
        result = self.connector.send(self.service_name, method, *args)
      File "D:\openerp70\openerp\addons\web\common\session.py", line 66, in send
        raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


    Server Traceback (most recent call last):
      File "D:\openerp70\openerp\addons\web\common\session.py", line 51, in send
        return openerp.netsvc.dispatch_rpc(service_name, method, args)
      File "D:\openerp70\openerp\netsvc.py", line 362, in dispatch_rpc
        result = ExportService.getService(service_name).dispatch(method, params)
      File "D:\openerp70\openerp\service\web_services.py", line 397, in dispatch
        return fn(*params)
      File "D:\openerp70\openerp\service\web_services.py", line 408, in exp_authenticate
        res_users = pooler.get_pool(db).get('res.users')
      File "D:\openerp70\openerp\pooler.py", line 50, in get_pool
        return get_db_and_pool(db_name, force_demo, status, update_module)[1]
      File "D:\openerp70\openerp\pooler.py", line 33, in get_db_and_pool
        registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
      File "D:\openerp70\openerp\modules\registry.py", line 154, in get
        update_module, pooljobs)
      File "D:\openerp70\openerp\modules\registry.py", line 176, in new
        openerp.modules.load_modules(registry.db, force_demo, status, update_module)
      File "D:\openerp70\openerp\modules\loading.py", line 289, in load_modules
        loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
      File "D:\openerp70\openerp\modules\loading.py", line 180, in load_module_graph
        load_data(module_name, idref, mode)
      File "D:\openerp70\openerp\modules\loading.py", line 78, in <lambda>
        load_data = lambda *args: _load_data(cr, *args, kind='data')
      File "D:\openerp70\openerp\modules\loading.py", line 125, in _load_data
        tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
      File "D:\openerp70\openerp\tools\convert.py", line 965, in convert_xml_import
        obj.parse(doc.getroot())
      File "D:\openerp70\openerp\tools\convert.py", line 858, in parse
        self._tags[rec.tag](self.cr, rec, n)
      File "D:\openerp70\openerp\tools\convert.py", line 825, 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 "D:\openerp70\openerp\addons\base\ir\ir_model.py", line 814, in _update
        res_id = model_obj.create(cr, uid, values, context=context)
      File "D:\openerp70\openerp\addons\base\res\res_partner.py", line 370, in create
        return super(res_partner,self).create(cr, uid, vals, context=context)
      File "D:\openerp70\openerp\osv\orm.py", line 4188, in create
        vals = self._add_missing_default_values(cr, user, vals, context)
      File "D:\openerp70\openerp\osv\orm.py", line 2410, in _add_missing_default_values
        defaults = self.default_get(cr, uid, missing_defaults, context)
      File "D:\openerp70\openerp\osv\orm.py", line 1506, in default_get
        defaults[f] = self._defaults[f](self, cr, uid, context)
      File "D:\openerp70\openerp\addons\base\res\res_partner.py", line 292, in <lambda>
        'image': lambda self, cr, uid, ctx: self._get_default_image(cr, uid, ctx.get('default_is_company', False), ctx),
      File "D:\openerp70\openerp\addons\base\res\res_partner.py", line 271, in _get_default_image
        return tools.image_resize_image_big(image.encode('base64'))
      File "D:\openerp70\openerp\tools\image.py", line 91, in image_resize_image_big
        return image_resize_image(base64_source, size, encoding, filetype, avoid_if_small)
      File "D:\openerp70\openerp\tools\image.py", line 66, in image_resize_image
        image = Image.open(image_stream)
      File "D:\Python26\lib\site-packages\pil-1.1.7-py2.6-win32.egg\Image.py", line 1980, in open
        raise IOError("cannot identify image file")
    IOError: cannot identify image file

    望高手解决上述问题,否则无法继续测试!



  • 我没研究过新版的系统,看似问题不少。
    表面上看,这个异常是在获取客户某些缩略图引起的。

    <br />image = Image.open(image_stream)<br />
    



    这句,Image对象只接受infile (name or stream obj). 不会接受一个base64编码的string.
    从上面的代码看,其实系统是从数据库里拿出了数据,base64 encode以后,交给PIL的。

    要想PIL从base64 string读取图片,则需要:

    <br />from PIL import Image<br />from base64 import decodestring<br /><br />image = Image.fromstring(&#039;RGB&#039;,(width,height),decodestring(imagestr))<br />image.save(&quot;foo.png&quot;)<br /><br />
    




    仅供参考。


  • Banned

    OE 仅支持 PIL >= 1.1.7  版本,安装此版本后应该可以解决PIL报错问题。


Log in to reply