跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 浅色
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • 深色
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 新手求助
  4. Webkit 报表打印报错

Webkit 报表打印报错

已定时 已固定 已锁定 已移动 Odoo 新手求助
5 帖子 3 发布者 7.6k 浏览 1 关注中
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • B 离线
    B 离线
    bluesthink
    发表于 最后由 编辑
    #1

    安装了report_webkit和report_webkit_sample模块。一打印就报错,错误如下,从日志上看是PDF文件没有生成,不知何故?
    难道需要配置wkhtmltopdf的路径吗?但我在公司->webkit标签上找不到设置路径的地方啊?


    2013-02-05 05:08:15,151 29967 ERROR ? openerp.service.web_services: Exception: [Errno 2] No such file or directory: '/tmp/webkit.tmp.cxwjlj.pdf'
    Traceback (most recent call last):
      File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 727, in go
        (result, format) = obj.create(cr, uid, ids, datas, context)
      File "/usr/lib/pymodules/python2.7/openerp/addons/report_webkit/webkit_report.py", line 325, in create
        result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
      File "/usr/lib/pymodules/python2.7/openerp/report/report_sxw.py", line 509, in create_source_pdf
        return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
      File "/usr/lib/pymodules/python2.7/openerp/addons/report_webkit/webkit_report.py", line 299, in create_single_pdf
        pdf = self.generate_pdf(bin, report_xml, head, foot, htmls)
      File "/usr/lib/pymodules/python2.7/openerp/addons/report_webkit/webkit_report.py", line 174, in generate_pdf
        pdf = file(out_filename, 'rb').read()
    IOError: [Errno 2] No such file or directory: '/tmp/webkit.tmp.cxwjlj.pdf'
    2013-02-05 05:08:15,301 29967 ERROR ? openerp.netsvc: 2
    No such file or directory

    1 条回复 最后回复
    0
    • B 离线
      B 离线
      bluesthink
      发表于 最后由 编辑
      #2


      我用的操作系统版本是ubantu11.04,前2天曾经怀疑是wkhtmltopdf的问题,安装webkit_report模块的说明,检查了一下是0.9.9版本符合要求。而且用apt-get install提示已经是最新版本,就没有往这个方向考虑了。

      这两日还是无解,只好到http://code.google.com/p/wkhtmltopdf上再看看,发现版本0.11.0才是最新的版本,同时看到说在ubantu上务必用静态链接库生成的wkhtmltopdf,否则可能会有页眉、页脚打印方面的问题。就尝试了一下,问题得到解决。

      步骤:

      1、从http://code.google.com/p/wkhtmltopdf下载文件wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2。
      2、解压得到文件wkhtmltopdf-amd64,将其改名twkhtmltopdf放到/usr/bin目录下。
      3、增加执行权限: chmod 755 htmltopdf 

      请注意若是64位操作系统,请下载wkhtmltopdf-amd64(不论你的CPU是amd的还是intel的)。另外,研究了一下,当前
      版本的webkit_report模块不需要再配置wkhtmltopdf路径了,模块会自动找到这个文件的。

      1 条回复 最后回复
      0
      • M 离线
        M 离线
        mrshelly
        发表于 最后由 编辑
        #3

        感谢分享.....

        1 条回复 最后回复
        0
        • J 离线
          J 离线
          janden
          发表于 最后由 编辑
          #4

          我测试的时候打印报表输出这个出错信息:coercing to Unicode: need string or buffer, bool found。 请问会有什么原因造成的呀?

          1 条回复 最后回复
          0

          你好!看起来您对这段对话很感兴趣,但您还没有一个账号。

          厌倦了每次访问都刷到同样的帖子?您注册账号后,您每次返回时都能精准定位到您上次浏览的位置,并可选择接收新回复通知(通过邮件或推送通知)。您还能收藏书签、为帖子顶,向社区成员表达您的欣赏。

          有了你的建议,这篇帖子会更精彩哦 💗

          注册 登录
          回复
          • 在新帖中回复
          登录后回复
          • 从旧到新
          • 从新到旧
          • 最多赞同


          • 登录

          • 没有帐号? 注册

          • 登录或注册以进行搜索。
          • 第一个帖子
            最后一个帖子
          0
          • 版块
          • 标签
          • 热门
          • 用户
          • 群组