[FIX]: purchase: Fixed invoiced rate for purchase order
authorRucha (Open ERP) <rpa@tinyerp.com>
Thu, 14 Apr 2011 09:35:40 +0000 (15:05 +0530)
committerRucha (Open ERP) <rpa@tinyerp.com>
Thu, 14 Apr 2011 09:35:40 +0000 (15:05 +0530)
bzr revid: rpa@tinyerp.com-20110414093540-lv5x998zs3cv770b

addons/purchase/purchase.py

index 6f6ab0c..324fe13 100644 (file)
@@ -98,7 +98,7 @@ class purchase_order(osv.osv):
             tot = 0.0
             for invoice in purchase.invoice_ids:
                 if invoice.state not in ('draft','cancel'):
-                    tot += invoice.amount_untaxed
+                    tot += (invoice.amount_untaxed - invoice.residual)
             if purchase.amount_untaxed:
                 res[purchase.id] = tot * 100.0 / purchase.amount_untaxed
             else: