Odoo Help

Welcome!

This community 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.

1

How to print page subtotal on report?

By
Erick Dyck
on 7/8/15, 3:00 AM 689 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.


    -1

    Serpent Consulting Services Pvt. Ltd.

    --Serpent Consulting Services Pvt. Ltd.--
    4341
    | 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

    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.


    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

    Your Answer

    Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

    About This Community

    This community is for professionals and enthusiasts of our products and services. Read Guidelines

    Question tools

    3 follower(s)

    Stats

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