Skip to content

Commit

Permalink
FIX] web: allow section and subsection in report
Browse files Browse the repository at this point in the history
In 10.0 having a `section`, `subsection` or `subsubsection` on a footer
element would replace the content with the page top three level of
headings.

This was removed in 11.0 with b446930 after which only `page` (current
page number) and `pages` (total number of page) classes would work.

This commit reintroduces the above-mentionned classes.

opw-2226700

X-original-commit: 14c6b94
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
  • Loading branch information
fmdl and nle-odoo committed Apr 1, 2020
1 parent fbd07fa commit cdcb11a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions addons/web/views/report_templates.xml
Expand Up @@ -114,14 +114,15 @@
var z = x[i].split('=', 2);
vars[z[0]] = unescape(z[1]);
}
var fromPage = document.getElementsByClassName('page');
for(var j = 0; j&lt;fromPage.length; j++)
fromPage[j].textContent = vars['sitepage'];
var toPage = document.getElementsByClassName('topage');
for(var j = 0; j&lt;toPage.length; j++)
toPage[j].textContent = vars['sitepages'];

var index = vars['webpage'].split('.', 4)[3]
var x = ['sitepage', 'sitepages', 'section', 'subsection', 'subsubsection'];
var z = {'sitepage': 'page', 'sitepages': 'topage'};
for (var i in x) {
var y = document.getElementsByClassName(z[x[i]] || x[i])
for (var j=0; j&lt;y.length; ++j)
y[j].textContent = vars[x[i]];
}

var index = vars['webpage'].split('.', 4)[3];
var header = document.getElementById('minimal_layout_report_headers');
if(header !== null){
var companyHeader = header.children[index];
Expand Down

0 comments on commit cdcb11a

Please sign in to comment.