diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2020-03-20 11:16:57 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2020-03-25 16:09:34 +0000 |
| commit | 71e163be9bf50e06699ca9e94b25938f18a6918f (patch) | |
| tree | 2f9409ddf5c135b2185b217f80e3afbdc5bab8da /doc/reference/javascript_reference.rst | |
| parent | f3182c6035b502bc99144e00b502cc39fd88536b (diff) | |
[FIX] base: cut multipage multi-documents on top heading
When we print a report for multiple records, we call wkhtmltopdf one
time and to save each document separately, we will split the PDF based
on its outline if it is available.
The outline is generated by wkhtmltopdf based on headings
(H1,H2,H3,H4,H5,H6,H7,H8,H9 elements) for example this document:
```
<h1>hello</h1>
<h2>world</h2>
<h1>!</h1>
```
has this abbreviated outline structure:
```
/Outlines: {
'/First': {
'/Title': 'hello'
'/First': {
'/Title': 'world'
},
'/Next': {
'/Title': '!'
}
}
}
```
But the current heuristic did not take into account level of headings,
so if the document had a lower-level headings this could break the
multi-printing of these reports.
So for the example above, the document would be cut in 3 when in reality
we only want to cut it twice over the top level heading (`<h1/>` here).
An existing issue in Odoo is in l10n_in_sale, `<h6/>` element are added
to the report invoice line so instead of only one `<h2/>` heading
containing the invoice name per document, there was an additional
heading per invoice line which broke the heuristic.
note: we also add an assertion to ensure first heading is on first page.
note: allowing several top-level heading on same page has been
implemented so reports that did not work in 11.0 but worked in 12.0 and
over (thanks to 573e57773) still work after this change.
opw-2188767
closes #48099
closes odoo/odoo#48374
X-original-commit: 63c2478cc9fb21afb83d31b04ff6c6090ee492ab
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'doc/reference/javascript_reference.rst')
0 files changed, 0 insertions, 0 deletions
