Search code examples
htmlcssxmlreportodoo

(Odoo Report) How to past field values at the start of the page for every product


I want to print a custom-made purchase order where I list the products that have been purchased. Every product needs to have a separate page where information such as bar code, name, description, etc will be added. So what I am actually struggling with is how can I insert the information of a product right at the start of a new page.

Example

The information for the first product is shown at the start of page number 1.

The information for the second product is shown at the start of page number 2.

Thanks


Solution

  • You could do a page break in qweb using something like this:

    <div style="page-break-before: always;">
       ...
    </div>
    

    More options are:

    <p style="page-break-before:always;"> </p> (mostly reports used this type)
    
    <p style="page-break-after:always"></p>
    
    <div style="page-break-after: auto;"><span style="display: none;"> </span></div>
    
    <p style="page-break-inside: avoid">
    
    <div style="page-break-inside: auto"></div>