openerp wkhtmltopdf 打印报错



https://bugs.launchpad.net/openerp-web/+bug/1193563

And following in the logs:

2013-06-22 07:12:50,987 24036 ERROR openerp openerp.addons.web.http.HttpRequest.dispatch: An error occurred while handling a json request
Traceback (most recent call last):
  File "/usr/openerp/addons/web/http.py", line 285, in dispatch
    r = method(self, **self.params)
  File "/usr/openerp/addons/web/controllers/main.py", line 1767, in index
    cookies={'fileToken': int(token)})
  File "/usr/openerp/addons/web/http.py", line 332, in make_response
    response.set_cookie(k, v)
  File "/usr/lib64/python2.7/site-packages/werkzeug/wrappers.py", line 960, in set_cookie
    self.charset))
  File "/usr/lib64/python2.7/site-packages/werkzeug/http.py", line 905, in dump_cookie
    value = to_bytes(value, charset)
  File "/usr/lib64/python2.7/site-packages/werkzeug/_compat.py", line 106, in to_bytes
    raise TypeError('Expected bytes')
TypeError: Expected bytes


原因可能是

werkzeug 库更新,致使oe出现bug


需对以下文件做修改


=== modified file 'addons/web/controllers/main.py'
2--- addons/web/controllers/main.py 2013-07-02 12:20:14 +0000
3+++ addons/web/controllers/main.py 2013-07-09 19:21:27 +0000
4@@ -812,7 +812,7 @@
5 return req.make_response(db_dump,
6 [('Content-Type', 'application/octet-stream; charset=binary'),
7 ('Content-Disposition', content_disposition(filename, req))],
8- {'fileToken': int(token)}
9+ {'fileToken': token}
10 )
11 except xmlrpclib.Fault, e:
12 return simplejson.dumps([[],[{'error': e.faultCode, 'title': _('Backup Database')}]])
13@@ -1320,7 +1320,7 @@
14 return req.make_response(filecontent,
15 headers=[('Content-Type', 'application/octet-stream'),
16 ('Content-Disposition', content_disposition(filename, req))],
17- cookies={'fileToken': int(token)})
18+ cookies={'fileToken': token})
19
20 @openerpweb.httprequest
21 def upload(self, req, callback, ufile):
22@@ -1627,7 +1627,7 @@
23 headers=[('Content-Disposition',
24 content_disposition(self.filename(model), req)),
25 ('Content-Type', self.content_type)],
26- cookies={'fileToken': int(token)})
27+ cookies={'fileToken': token})
28
29 class CSVExport(ExportFormat, http.Controller):
30 _cp_path = '/web/export/csv'
31@@ -1767,6 +1767,6 @@
32 ('Content-Disposition', content_disposition(file_name, req)),
33 ('Content-Type', report_mimetype),
34 ('Content-Length', len(report))],
35- cookies={'fileToken': int(token)})
36+ cookies={'fileToken': token})
37
38 # vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值