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
1=== modified file 'purchase/purchase.py'
2--- purchase/purchase.py 2011-02-21 07:25:45 +0000
3+++ purchase/purchase.py 2011-05-17 11:54:29 +0000
4@@ -98,7 +98,7 @@
5 tot = 0.0
6 for invoice in purchase.invoice_ids:
7 if invoice.state not in ('draft','cancel'):
8- tot += invoice.amount_untaxed
9+ tot += invoice.amount_untaxed - invoice.residual
10 if purchase.amount_untaxed:
11 res[purchase.id] = tot * 100.0 / purchase.amount_untaxed
12 else:
13
14=== modified file 'sale/sale.py'
15--- sale/sale.py 2011-01-19 08:38:17 +0000
16+++ sale/sale.py 2011-05-17 11:54:29 +0000
17@@ -131,7 +131,7 @@
18 tot = 0.0
19 for invoice in sale.invoice_ids:
20 if invoice.state not in ('draft', 'cancel'):
21- tot += invoice.amount_untaxed
22+ tot += invoice.amount_untaxed - invoice.residual
23 if tot:
24 res[sale.id] = min(100.0, tot * 100.0 / (sale.amount_untaxed or 1.00))
25 else: