Skip to content

Commit

Permalink
[FIX] report: don't call subst() if not defined
Browse files Browse the repository at this point in the history
In case you are printing in html a report with minimal layout, you will have an error
since the function is not defined, but called by the onload of the body tag.

Now we don't call subst if it is not needed (and so not declared)

closes odoo#29341
JKE-be committed Dec 7, 2018
1 parent 8a05ad7 commit a5f4195
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions addons/web/views/report_templates.xml
Original file line number Diff line number Diff line change
@@ -103,7 +103,8 @@
<t t-call-assets="web.report_assets_common" t-js="false"/>
<t t-call-assets="web.report_assets_pdf" t-css="false"/>
<meta charset="utf-8"/>
<t t-if="subst is True">
<t t-set="subst_needed" t-value="subst is True"/>
<t t-if="subst_needed">
<script>
function subst() {
var vars = {};
@@ -136,7 +137,7 @@
</script>
</t>
</head>
<body class="container" onload="subst()">
<body class="container" t-att-onload="subst_needed and 'subst()'">
<t t-raw="body"/>
</body>
</html>

0 comments on commit a5f4195

Please sign in to comment.