Skip to content

Commit

Permalink
[FIX] base: report generation error
Browse files Browse the repository at this point in the history
origin: https://www.odoo.com/web#id=1850777&model=project.task&view_type=form&menu_id=
and https://www.odoo.com/web#id=1850289&active_id=1850289&model=project.task&view_type=form
both support tickets are about an error when trying to print the report
'delivery slip'.

The error is a seg-fault in wkhtmltopdf, when it is computing the number
of pages, it is trying to know ahead of render how many pages it will
need but the computation uses a default viewport-size that is very
small, making the computation wrong. It can either foresee more pages
than it needs and the report looks perfect or not enough pages and there
is a seg-fault when rendering the data without pages to render on.

The fix is simple: give in the command line argument a reasonnable
viewport-size so that it will *more likely* compute more pages than it
needs. To do that, I changed the default of the parameters
set_viewport_size to True.
  • Loading branch information
VincentSchippefilt committed May 24, 2018
1 parent 04dd688 commit 671f963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion odoo/addons/base/ir/ir_actions_report.py
Expand Up @@ -197,7 +197,7 @@ def _build_wkhtmltopdf_args(
paperformat_id,
landscape,
specific_paperformat_args=None,
set_viewport_size=False):
set_viewport_size=True):
'''Build arguments understandable by wkhtmltopdf bin.
:param paperformat_id: A report.paperformat record.
Expand Down

0 comments on commit 671f963

Please sign in to comment.