Odoo Help


Different type of Invoice (based on total amount of work done deducting what is payed)

on 5/25/16, 5:06 PM 895 views

More and more often our clients (construction company) are asking for invoice showing the total amount of work done until now. For example:

Project: Painting a house
Total amount:
100 m2
Price: 10€ per m2

First Invoice:
  Painting: 20 m2
  SubTotal: 200€
  To Deduct: 0€
  Total: 200€

Now the client pays it and the next day we paint 30 m2 more and the next invoice is gonna read:

Second Invocie:
Painting: 20 m2
  Painting: 30 m2
  SubTotal: 500€
  To Deduct: 200€ (because they are paid from the past invoice)
  Total: 300€

So every next invoice is gonna have the lines of the past invoices (for that project) deducting the amount that is payed. Basically I want to print a report for an invoice having the Header of the current invoice but the orderlines including all the lines from the past invoices of that project and in the footer having SubTotal from All the lines and Deducting what is payed for the Total.

So the question is: How can you achieve that with Odoo v9? The first thing I imagine is adding an Many2one field "Project" to the account.invoice so you can sort them by Project.

Now about the invoice I had a few ideas:

  1. Making a  report layout and looping through all the invoices checking if they belong to the current invoice project and adding the orderlines + checking which of them was payed to deduct from the total. Is it possible from Report for model "account.invoice" to access other invoices? smth like

    <t t-foreach="docs" t-as="o">

    but for all invoices.

  2. Another thing I thought was to make a filter on the added "Project field" so i can see only the invoices for certain Project and the report will loop with

    <t t-foreach...

    Adding all the order lines to the report. The problem here is how do you know for which invoice you make the report. Since I'll need to have the Invoice Number for example in the header.

Well you can see I am quite lost with this. I would appreciate any help.

Edser Solis
On 5/25/16, 11:14 PM

Hola Magen, have to talk to you in english because of forum rules. 

Wouldn't it be easier to just use a proforma invoice? 

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: 5/25/16, 5:06 PM
Seen: 895 times
Last updated: 5/25/16, 11:14 PM