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

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

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

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

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

上传附件中文命名,下载的时候就报错,请教



  • 系统ubuntu11.10 openerp版本6.1 人力资源员工信息中上传附件如果是中文命名下载就报错
    2012-05-05 03:28:16,211 1235 ERROR ? werkzeug: Error on request:
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 159, in run_wsgi
        execute(app)
      File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 146, in execute
        application_iter = app(environ, start_response)
      File "/opt/openerp/server/openerp/wsgi/core.py", line 397, in application
        result = handler(environ, start_response)
      File "/opt/openerp/server/openerp/addons/web/common/http.py", line 467, in call
        return self.dispatch(environ, start_response)
      File "/usr/local/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 411, in call
        return self.app(environ, start_response)
      File "/opt/openerp/server/openerp/addons/web/common/http.py", line 505, in dispatch
        return response(environ, start_response)
      File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 1082, in call
        app_iter, status, headers = self.get_wsgi_response(environ)
      File "/usr/local/lib/python2.7/dist-packages/werkzeug/wrappers.py", line 1072, in get_wsgi_response
        return app_iter, self.status, headers.to_list()
      File "/usr/local/lib/python2.7/dist-packages/werkzeug/datastructures.py", line 1141, in to_list
        for k, v in self]
    UnicodeEncodeError: 'latin-1' codec can't encode characters in position 22-27: ordinal not in range(256)

    请教下如何解决?



  • 这个要改源代码:

    @addons/web/controllers/main.py
    Binary类的saveas和saveas_ajax方法中:
    在 return req.make_response(....)前面插入
    if isinstance(filename, unicode): filename=filename.encode('utf8')

    重启即可



  • 搞定,谢谢!


  • 管理员

    楼主的是直接用右边的附件就出现错误?



  • 文档管理里面也一样,就是附件名中文编码的问题。新手,不知道如何解决,感谢有人帮忙啊! 😃


Log in to reply