Odoo Help


How to print page subtotal on report?

Erick Dyck
on 7/8/15, 3:00 AM 1,429 views


we need for our company report to print per page an subtotal in the table footer. If the last page is reached, it should print the amount untaxed.

We tried this by defining a variable before the loop starts. In the loop itself we add the product subtotal to the variable and printing it in the table footer. But this didn't work as expected. The subtotal on page one and page two are the same.

For better understanding what we want:

Page one

Product 1
Product 2
Product 3

Page two

    Product 4
    Amount untaxed

    Currently it prints the amount untaxed on every page.


    Serpent Consulting Services Pvt. Ltd.

    --Serpent Consulting Services Pvt. Ltd.--
    | 6 6 8
    Gandhinagar, India
    --Serpent Consulting Services Pvt. Ltd.--

    Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

    Serpent Consulting Services Pvt. Ltd.
    On 7/8/15, 6:30 AM


    Usually while the reports is getting printed, its hard to know whether the end of the page has reached or not.

    If your line size is fixed say 10, you can define like...after the 9th line is printed, you add the subtotal of 9 lines asthe 10th line. And later on, the 11th line will print the 10th sale orer line and so on.


    I think this wouldn't work. Because of the product description the invoice lines have different heights, so sometimes there are three invoice lines per page, sometimes five. But thanks for your answer.

    Erick Dyck
    on 7/9/15, 2:19 AM

    Oops, setting -1 on answer hurts! Anyways, we've done such a report where we limit the height of the cell and of the text too. Imagine one prod description is of 5 line para! Logically, its hard to fetch how much size is occupied. So you must set a standard to display 2 lines description max and denote by ... and more!

    Serpent Consulting Services Pvt. Ltd.
    on 7/9/15, 4:04 AM

    We haven't rated your answer ;) Limiting the description is no option for us. We just can't cut the description to let's say two lines, the informations in the description are too important. There must be a way to detect such things like page-break, so that we can close the table and reopen it again. Afaik this solution does already exist in Odoo, but not for a single invoice.

    Erick Dyck
    on 7/10/15, 2:50 AM

    Page break exists, but on what basis we would use it, is the concern. Breaking page at height, breaking page at records,etc. Closing table will be hard as the engine needs to work on continous printing as the output type can be HTML too. Thanks.

    Serpent Consulting Services Pvt. Ltd.
    on 7/10/15, 4:16 AM

    About This Community

    This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


    Odoo Training Center

    Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

    Test it now

    Question tools

    3 follower(s)


    Asked: 7/8/15, 3:00 AM
    Seen: 1429 times
    Last updated: 7/8/15, 6:30 AM