[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:
@@ -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
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user