There's more...

There are some marker classes in a report's HTML that are crucial for the layout. Ensure that you wrap all your content in an element with the class page set. If you forget that, you'll see nothing at all. To add a header or footer to your record, use the class header or footer.

Also, remember that this is HTML, so make use of CSS attributes such as page-break-before, page-break-after, and page-break-inside.

You'll have noted that all of our template body is wrapped in two elements with the t-call attribute set. We'll examine the mechanics of this attribute later, but it is crucial that you do the same in your reports. These elements take care that the HTML generated links to all the necessary CSS files and contains some other data needed for the report generation. While web.html_container doesn't really have an alternative, the second t-call can also be web.external_layout. The difference is that the external layout already comes with a header and footer displaying the company logo, the company's name, and some other information you expect from a company's external communication, while the internal layout just gives you a header with pagination, the print date, and the company's name. For the sake of consistency, always use one of the two.

Note that  web.internal_layoutweb.external_layout, web.external_layout_header, and web.external_layout_footer (the last two are called by the external layout) are just views by themselves, and you already know how to change them by inheritance. To inherit with the template element, use the inherit_id attribute.
In the previous versions of Odoo, these templates were defined in the report module, not web. When porting a module to Odoo 11, don't forget to change the identifiers in you calls to t-call.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.216.249