Odoo Help


Advance Invoice per percentage - Have the tax included on both Invoice not only on the last one

on 1/26/16, 9:42 AM 1,205 views

Hi everybody,

I am using the "percentage" mode to do my invoice from my sale order.

Right now I have this:

Sale order price withouth VAT = 1 000 euros. Tax = 210 euros. Total = 12100 euros

With percentage I have for my first Invoice:

Total: 6050 euros , Tax = 0 euros, Withouth VAT =6050  euros

The second Invoice

Total : 6050  euros, Tax = 1210 euros, Without VAT =4840


Is it possible to have the VAT not just on the last one but on the first one too?

So to have for both:

TOTAL: 6050 VAT = 1050, Without VAT = 5000


I suppose that for it I will have to modify the file sale_make_invoice_advance.py

I will have to change this line ( in order take the unit price without VAT) 

inv_amount = sale.amount_total * wizard.amount / 100


inv_amount_untaxed = sale.amount_untaxed* wizard.amount / 100

However how can I get the Tax? The code is bellow

if wizard.advance_payment_method == 'percentage':

inv_amount = sale.amount_total * wizard.amount / 100

if not res.get('name'):

res['name'] = _("Advance of %s %%") % (wizard.amount)


inv_amount = wizard.amount

if not res.get('name'):

#TODO: should find a way to call formatLang() from rml_parse

symbol = sale.pricelist_id.currency_id.symbol

if sale.pricelist_id.currency_id.position == 'after':

res['name'] = _("Advance of %s %s") % (inv_amount, symbol)


res['name'] = _("Advance of %s %s") % (symbol, inv_amount)

# determine taxes

if res.get('invoice_line_tax_id'):

res['invoice_line_tax_id'] = [(6, 0, res.get('invoice_line_tax_id'))]


res['invoice_line_tax_id'] = False

Many thanks for your help and yuor time,


A little up for the hope :-).

Thank you!

on 1/29/16, 5:58 AM
On 6/15/16, 9:16 AM

Hi Selverine,

Same question and part of solution was here:


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

1 follower(s)


Asked: 1/26/16, 9:42 AM
Seen: 1205 times
Last updated: 6/15/16, 9:16 AM