[FIX] Report: do not raise when wkhtmltopdf returns a code 1. In most cases, it is due to some http requests which did not success *but* the pdf is still acceptable. Far from the best commit ever, but it avoids to completely crash when just a link to an image is wrong

This commit is contained in:
Simon Lejeune 2014-05-21 12:56:56 +02:00
parent 35c5e56718
commit 4019b2b334
1 changed files with 1 additions and 3 deletions

View File

@ -353,8 +353,6 @@ class Report(osv.Model):
if paperformat:
command_args.extend(self._build_wkhtmltopdf_args(paperformat, spec_paperformat_args))
command_args.extend(['--load-error-handling', 'ignore'])
if landscape and '--orientation' in command_args:
command_args_copy = list(command_args)
for index, elem in enumerate(command_args_copy):
@ -417,7 +415,7 @@ class Report(osv.Model):
if config['workers'] == 1:
os.kill(ppid, signal.SIGTTOU)
if process.returncode != 0:
if process.returncode not in [0, 1]:
raise osv.except_osv(_('Report (PDF)'),
_('wkhtmltopdf failed with error code = %s. '
'Message: %s') % (str(process.returncode), err))