diff options
| author | Simon Lejeune <sle@openerp.com> | 2016-06-09 13:41:07 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2016-12-07 11:30:04 +0100 |
| commit | 7ccf4e60c86d80ce38e8e7f33d1d42940384306c (patch) | |
| tree | 8320f84f5050ba17816a6d9b639fb80fc064fb24 /addons/report/static | |
| parent | 7cdd90e95d5fe71d2b146535e152f849155af31c (diff) | |
[FIX] report: correctly handle broken wkhtmltopdf
It's possible that the command `wkhtmltopdf --version` returns an empty
string (in the use case, it output later in stdout "wkhtmltopdf: error
while loading shared libraries: libfontconfig.so.1: cannot open shared
object file: No such file or directory").
We chose to display the report in html in this case and also to show
a warning to the user inviting him to fix his installation.
Diffstat (limited to 'addons/report/static')
| -rw-r--r-- | addons/report/static/src/js/qwebactionmanager.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/report/static/src/js/qwebactionmanager.js b/addons/report/static/src/js/qwebactionmanager.js index 1f7084aecd7..543068ac30f 100644 --- a/addons/report/static/src/js/qwebactionmanager.js +++ b/addons/report/static/src/js/qwebactionmanager.js @@ -92,6 +92,13 @@ workers to print a pdf version of the reports.'), true); Wkhtmltopdf to at least 0.12.0 in order to get a correct display of headers and footers as well as\ support for table-breaking between pages.<br><br><a href="http://wkhtmltopdf.org/" \ target="_blank">wkhtmltopdf.org</a>'), true); + } else if (presence === 'broken') { + self.do_notify(_t('Report'), _t('Your installation of Wkhtmltopdf seems to be broken. The \ +report will be shown in html.<br><br><a href="http://wkhtmltopdf.org/" target="_blank">wkhtmltopdf.org</a>'), true); + report_url = report_url.substring(12); + window.open('/report/html/' + report_url, '_blank', 'height=768,width=1024'); + framework.unblockUI(); + return; } return trigger_download(self.session, response, c, action, options); }); |
