Openerp Webkit报告给出了OsError

时间:2014-05-28 13:57:51

标签: python openerp wkhtmltopdf

我想在我的openerp7上使用webkit报告引擎,我按照本网站上的网站上的确切程序进行了教程http://castilloinformatica.com/wiki/index.php?title=Webkit_Report_Engine

我已经安装了这些模块,

sale,
report_webkit,
base_headers_webkit,
report_webkit_chapter_server,
invoice_webkit,
sale_order_webkit

并将/ usr / bin / wkhtmltopdf添加到设置

当我尝试打印报价单时,会发出以下错误:

- - [28/May/2014 13:47:47] "POST /web/dataset/call_button HTTP/1.1" 200 -
2014-05-28 13:47:47,470 1877 ERROR openerp-report-demo-data3 openerp.addons.report_webkit.webkit_report: cannot remove file /tmp/webkit.tmp.8sv0Eg.pdf: [Errno 2] No such file or directory: '/tmp/webkit.tmp.8sv0Eg.pdf'
2014-05-28 13:47:47,470 1877 ERROR openerp-report-demo-data3 openerp.service.web_services: Exception: [Errno 8] Exec format error
Traceback (most recent call last):
  File "/opt/openerp-report/server/openerp/service/web_services.py", line 712, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/opt/openerp-report/addons/report_webkit/webkit_report.py", line 340, in create
    result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
  File "/opt/openerp-report/server/openerp/report/report_sxw.py", line 513, in create_source_pdf
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/opt/openerp-report/addons/report_webkit/webkit_report.py", line 314, in create_single_pdf
    pdf = self.generate_pdf(bin, report_xml, head, foot, htmls)
  File "/opt/openerp-report/addons/report_webkit/webkit_report.py", line 165, in generate_pdf
    status = subprocess.call(command, stderr=stderr_fd)
  File "/usr/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
2014-05-28 13:47:47,622 1877 ERROR openerp-report-demo-data3 openerp.netsvc: 8
Exec format error
(<type 'exceptions.OSError'>, OSError(8, 'Exec format error'), <traceback object at 0xb3f6bdec>)
Traceback (most recent call last):
  File "/opt/openerp-report/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp-report/server/openerp/service/web_services.py", line 654, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp-report/server/openerp/service/web_services.py", line 760, in exp_report_get
    return self._check_report(report_id)
  File "/opt/openerp-report/server/openerp/service/web_services.py", line 738, in _check_report
    netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
  File "/opt/openerp-report/server/openerp/netsvc.py", line 71, in abort_response
    raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'8\nExec format error', (<type 'exceptions.OSError'>, OSError(8, 'Exec format error'), <traceback object at 0xb3f6bdec>))
> /opt/openerp-report/server/openerp/netsvc.py(71)abort_response()
-> raise openerp.osv.osv.except_osv(description, details)
(Pdb) 

如何摆脱这个错误

2 个答案:

答案 0 :(得分:1)

这里的问题是系统参数webkit_path的误导性名称。你可以想象这是wkhtmltopdf的路径/目录。

webkit_path必须包含可执行文件的路径。在Linux中,这将是例如

/home/my_home_dir/wkhtmltopdf/bin/wkhtmltopdf

在Windows中它可能是

C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe

当然取决于wkhtmltox的安装路径。

答案 1 :(得分:0)

尝试在openerp中设置wkhtmltopdf路径(使用终端获取wkhtmltopdf路径类型&#34; wkhtmltopdf&#34;)

在settaing-&gt;系统参数下 希望你能