We found a workaround which seems to be the best way out at the moment.
Before we get into the workaround, let me try to explain the problem
Origin: Problem is with wkhtmltopdf, this problem seems to persist since a long time and has been reported even on Odoo forums
Problem: When the description of a line item is too long, wkhtmltopdf does not wrap text or add a page break automatically and that is the reason why the content gets overlapped on the next page’s header
Possible Workaround/Solution:
Case 1: When the line item in question, which is getting overlapped
a. is one of many line items in the given document and
b. the description of given line item is equal to or less than one page height
Solution: In this case your best bet is to introduce a avoid page break tag in CSS
thead { display: table-header-group; } tfoot { display: table-row-group; } tr { page-break-inside: avoid; }
Courtesy: https://stackoverflow.com/q/50504696
Case 2: When Description or text in question spans over 1 page height
This is a tricky one. The above CSS fix won’t fix this case.
In order to fix this we looked up the
number by Inspecting the overlapping content and added padding just before this div to make it wrap over to the next page
table tbody tr td div.value > :nth-last-child(4) { padding-bottom: 50px; }
Hope this helps