[FIX] account: residual amount computation with refund invoices
authorDenis Ledoux <dle@openerp.com>
Wed, 5 Feb 2014 10:03:24 +0000 (11:03 +0100)
committerDenis Ledoux <dle@openerp.com>
Wed, 5 Feb 2014 10:03:24 +0000 (11:03 +0100)
On invoice residual amount computing, we ignore reconcile entries line if their invoice are not of the same type of the current invoice
The above revision(s) will be removed

bzr revid: dle@openerp.com-20140205100324-5tyquozmylcp40p1

addons/account/account_invoice.py

index 5284b1e..55ba105 100644 (file)
@@ -117,7 +117,7 @@ class account_invoice(osv.osv):
                             #we check if the invoice is partially reconciled and if there are other invoices
                             #involved in this partial reconciliation (and we sum these invoices)
                             for line in aml.reconcile_partial_id.line_partial_ids:
-                                if line.invoice:
+                                if line.invoice and invoice.type == line.invoice.type:
                                     nb_inv_in_partial_rec += 1
                                     #store the max invoice id as for this invoice we will make a balance instead of a simple division
                                     max_invoice_id = max(max_invoice_id, line.invoice.id)