Rifakat Haradwala (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-bug-795026-rha into 
lp:openobject-addons/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-bug-795026-rha/+merge/64362

sale, purchase: fixed the calculation for invoice rate. Was showing wrong 
progress bar result for sale and purchase orders on invoices validation while 
we include the taxes.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-bug-795026-rha/+merge/64362
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-bug-795026-rha.
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py	2011-05-17 11:44:45 +0000
+++ purchase/purchase.py	2011-06-13 06:38:31 +0000
@@ -98,9 +98,9 @@
             tot = 0.0
             for invoice in purchase.invoice_ids:
                 if invoice.state not in ('draft','cancel'):
-                    tot += invoice.amount_untaxed - invoice.residual
-            if purchase.amount_untaxed:
-                res[purchase.id] = tot * 100.0 / purchase.amount_untaxed
+                    tot += invoice.amount_total - invoice.residual
+            if purchase.amount_total:
+                res[purchase.id] = (tot * 100.0 / (purchase.amount_total or 1.0))
             else:
                 res[purchase.id] = 0.0
         return res

=== modified file 'sale/sale.py'
--- sale/sale.py	2011-05-17 11:44:45 +0000
+++ sale/sale.py	2011-06-13 06:38:31 +0000
@@ -131,9 +131,9 @@
             tot = 0.0
             for invoice in sale.invoice_ids:
                 if invoice.state not in ('draft', 'cancel'):
-                    tot += invoice.amount_untaxed - invoice.residual
+                    tot += invoice.amount_total - invoice.residual
             if tot:
-                res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
+                res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_total or 1.00))
             else:
                 res[sale.id] = 0.0
         return res

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to