我想将webkit报表引擎与openerp7一起使用,我在此站点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)
我如何摆脱这个错误
最佳答案
这里的问题是系统参数webkit_path
的名称具有误导性。您会想象这是wkhtmltopdf的路径/目录。webkit_path
必须包含可执行文件的路径。在Linux中,例如
/home/my_home_dir/wkhtmltopdf/bin/wkhtmltopdf
在Windows中可能是
C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe
当然取决于wkhtmltox的安装路径。