Odoo 中文社区

    • 注册
    • 登录
    • 搜索
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组

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

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

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

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

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

    Webkit 报表打印报错

    Odoo 新手求助
    3
    5
    6123
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • B
      bluesthink 最后由 编辑

      安装了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
        bluesthink 最后由 编辑


        我用的操作系统版本是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
        • mrshelly
          mrshelly 最后由 编辑

          感谢分享.....

          1 条回复 最后回复 回复 引用 0
          • J
            janden 最后由 编辑

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

            1 条回复 最后回复 回复 引用 0
            • First post
              Last post