[FIX] Sale/Purchase : Calculation of invoice rates corrected,revert of previous commit http://bazaar.launchpad.net/~openerp/openobject-addons/6.0/revision/4593

lp bug: https://launchpad.net/bugs/795026 fixed

bzr revid: jvo@tinyerp.com-20110707105050-1ql2jji5pmblsu22
This commit is contained in:
Jay Vora (OpenERP)
2011-07-07 16:20:50 +05:30
parent 7c19f78210
commit 893a8fb7f8
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -98,9 +98,10 @@ 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 - invoice.residual
tot += invoice.amount_untaxed
if purchase.amount_untaxed:
res[purchase.id] = tot * 100.0 / purchase.amount_untaxed
res[purchase.id] = min(100.0, tot * 100.0 / (purchase.amount_untaxed))
else:
res[purchase.id] = 0.0
return res
+1 -1
View File
@@ -131,7 +131,7 @@ class sale_order(osv.osv):
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_untaxed
if tot:
res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
else: