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

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

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

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

原创:odoo导出po翻译文件报错的解决:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in



  • 卓忆原创:odoo导出po翻译文件报错的解决:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128) 的解决<br /><br />在导出po文件的时候 报错,报错全文如下:<br /><br />完整的如下:Traceback (most recent call last):<br />File "/opt/odoo/odoo-server/openerp/http.py", line 525, in _handle_exception<br />return super(JsonRequest, self)._handle_exception(exception)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 562, in dispatch<br />result = self._call_function(**self.params)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 302, in _call_function<br />return checked_call(self.db, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper<br />return f(dbname, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 299, in checked_call<br />return self.endpoint(*a, **kw)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 791, in call<br />return self.method(*args, **kw)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 395, in response_wrap<br />response = f(*args, **kw)<br />File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 953, in call_button<br />action = self._call_kw(model, method, args, {})<br />File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 941, in _call_kw<br />return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper<br />return old_api(self, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/addons/base/module/wizard/base_export_language.py", line 65, in act_getfile<br />tools.trans_export(lang, mods, buf, this.format, cr)<br />File "/opt/odoo/odoo-server/openerp/tools/translate.py", line 510, in trans_export<br />translations = trans_generate(lang, modules, cr)<br />File "/opt/odoo/odoo-server/openerp/tools/translate.py", line 875, in trans_generate<br />for root, dummy, files in osutil.walksymlinks(path):<br />File "/opt/odoo/odoo-server/openerp/tools/osutil.py", line 56, in walksymlinks<br />for dirpath, dirnames, filenames in os.walk(top, topdown, onerror):<br />File "/usr/lib/python2.7/os.py", line 294, in walk<br />for x in walk(new_path, topdown, onerror, followlinks):<br />File "/usr/lib/python2.7/os.py", line 284, in walk<br />if isdir(join(top, name)):<br />File "/usr/lib/python2.7/posixpath.py", line 80, in join<br />path += '/' + b<br />UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128)<br />12:05:36<br /><br />经过排查,发现可能是某个第三方模块导致的:<br /><br />那个模块只要放在 addons 目录里面,不用安装,导出依然会报错。<br />我估计 导出的时候 自动 遍历了整个 addons 目录。<br />原因是 这个模块的 xml 文件 最前面少了  encoding="utf-8"?<br /><br />正确的应该是 :<br /><?xml version="1.0" encoding="utf-8"?><br /><br /><br /><br />谢谢joshua和总监mrshelly。



  • 卓忆原创:odoo导出po翻译文件报错的解决:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128) 的解决<br /><br />在导出po文件的时候 报错,报错全文如下:<br /><br />完整的如下:Traceback (most recent call last):<br />File "/opt/odoo/odoo-server/openerp/http.py", line 525, in _handle_exception<br />return super(JsonRequest, self)._handle_exception(exception)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 562, in dispatch<br />result = self._call_function(**self.params)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 302, in _call_function<br />return checked_call(self.db, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper<br />return f(dbname, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 299, in checked_call<br />return self.endpoint(*a, **kw)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 791, in call<br />return self.method(*args, **kw)<br />File "/opt/odoo/odoo-server/openerp/http.py", line 395, in response_wrap<br />response = f(*args, **kw)<br />File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 953, in call_button<br />action = self._call_kw(model, method, args, {})<br />File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 941, in _call_kw<br />return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/api.py", line 241, in wrapper<br />return old_api(self, *args, **kwargs)<br />File "/opt/odoo/odoo-server/openerp/addons/base/module/wizard/base_export_language.py", line 65, in act_getfile<br />tools.trans_export(lang, mods, buf, this.format, cr)<br />File "/opt/odoo/odoo-server/openerp/tools/translate.py", line 510, in trans_export<br />translations = trans_generate(lang, modules, cr)<br />File "/opt/odoo/odoo-server/openerp/tools/translate.py", line 875, in trans_generate<br />for root, dummy, files in osutil.walksymlinks(path):<br />File "/opt/odoo/odoo-server/openerp/tools/osutil.py", line 56, in walksymlinks<br />for dirpath, dirnames, filenames in os.walk(top, topdown, onerror):<br />File "/usr/lib/python2.7/os.py", line 294, in walk<br />for x in walk(new_path, topdown, onerror, followlinks):<br />File "/usr/lib/python2.7/os.py", line 284, in walk<br />if isdir(join(top, name)):<br />File "/usr/lib/python2.7/posixpath.py", line 80, in join<br />path += '/' + b<br />UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128)<br />12:05:36<br /><br />经过排查,发现可能是某个第三方模块导致的:<br /><br />那个模块只要放在 addons 目录里面,不用安装,导出依然会报错。<br />我估计 导出的时候 自动 遍历了整个 addons 目录。<br />原因是 这个模块的 xml 文件 最前面少了  encoding="utf-8"?<br /><br />正确的应该是 :<br /><?xml version="1.0" encoding="utf-8"?><br /><br /><br /><br />谢谢joshua和总监mrshelly。



  • 嗯... 标准化模块开发... <br /><br />不推荐 直接在 xml view 中使用中文.<br />推荐使用翻译来做多语言...<br /><br />



  • 两种方法:1.在项目启动文件中添加一下代码:<br />[code]import sys <br />reload(sys) <br />sys.setdefaultencoding('utf8') [/code]<br />2.在环境的sitecustomize.py文件中添加以上代码。


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待