This question has been flagged
6 Replies
7016 Views

Hello,


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
300
Product 2
400
Product 3
500
Subtotal
1.200


Page two

    Product 4
    800
    Amount untaxed
    2.000         


    Currently it prints the amount untaxed on every page.


    Avatar
    Discard
    Best Answer

    Hi Sirs,

    I'm trying now with Odoo10c, but I'm unable. Some news about this behavior. It seems it is imposible to do it, isn't it?

    Thanks,

    Avatar
    Discard
    Best Answer

    Erick,

    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.

    Thanks.


    Avatar
    Discard
    Author

    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.

    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!

    Author

    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.

    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.