Merge lp:~openerp-dev/openobject-addons/6.0-sale-purchase-invoiced-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Rejected
Rejected by: Jay Vora (Serpent Consulting Services)
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-sale-purchase-invoiced-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 25 lines (+2/-2)
2 files modified
purchase/purchase.py (+1/-1)
sale/sale.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-sale-purchase-invoiced-rha
Reviewer Review Type Date Requested Status
Jay Vora (Serpent Consulting Services) (community) Approve
Review via email: mp+61236@code.launchpad.net

Description of the change

sale, purchase: corrected the calculation for invoiced rate of sale and purchase order

To post a comment you must log in.
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Rifakat,

This was a very good catch.

Thanks for the proposal, the fix has been merged into stable.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2011-02-21 07:25:45 +0000
+++ purchase/purchase.py 2011-05-17 11:54:29 +0000
@@ -98,7 +98,7 @@
98 tot = 0.098 tot = 0.0
99 for invoice in purchase.invoice_ids:99 for invoice in purchase.invoice_ids:
100 if invoice.state not in ('draft','cancel'):100 if invoice.state not in ('draft','cancel'):
101 tot += invoice.amount_untaxed101 tot += invoice.amount_untaxed - invoice.residual
102 if purchase.amount_untaxed:102 if purchase.amount_untaxed:
103 res[purchase.id] = tot * 100.0 / purchase.amount_untaxed103 res[purchase.id] = tot * 100.0 / purchase.amount_untaxed
104 else:104 else:
105105
=== modified file 'sale/sale.py'
--- sale/sale.py 2011-01-19 08:38:17 +0000
+++ sale/sale.py 2011-05-17 11:54:29 +0000
@@ -131,7 +131,7 @@
131 tot = 0.0131 tot = 0.0
132 for invoice in sale.invoice_ids:132 for invoice in sale.invoice_ids:
133 if invoice.state not in ('draft', 'cancel'):133 if invoice.state not in ('draft', 'cancel'):
134 tot += invoice.amount_untaxed134 tot += invoice.amount_untaxed - invoice.residual
135 if tot:135 if tot:
136 res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))136 res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
137 else:137 else: