Merge lp:~openerp-dev/openobject-addons/6.1-opw-581957-rha into lp:openobject-addons/6.1

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-581957-rha
Merge into: lp:openobject-addons/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
purchase/ (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-581957-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email:

Description of the change


Fixed issue for invoice rate of the purchase order. It cumulates amount of supplier
invoice and supplier refund invoice.

My fix calculates the rate by considering invoice amount - refund amount.
Please provide your remark if any.

Rifakat Haradwala

To post a comment you must log in.
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :


I recommend to take the code of as a reference.

The min() should better be used in order to limit it to 100%.


Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :


I think min() will just hide the problem. IMHO we just need to exclude refund amount
from the total.


7079. By Rifakat Husen (OpenERP)

[FIX] purchase: calculated rate for in invoice by excluding refund

Unmerged revisions

7079. By Rifakat Husen (OpenERP)

[FIX] purchase: calculated rate for in invoice by excluding refund

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase/'
2--- purchase/ 2012-10-09 12:16:14 +0000
3+++ purchase/ 2012-11-27 11:23:21 +0000
4@@ -90,7 +90,7 @@
5 for purchase in self.browse(cursor, user, ids, context=context):
6 tot = 0.0
7 for invoice in purchase.invoice_ids:
8- if invoice.state not in ('draft','cancel'):
9+ if invoice.state not in ('draft','cancel') and invoice.type == 'in_invoice':
10 tot += invoice.amount_untaxed
11 if purchase.amount_untaxed:
12 res[] = tot * 100.0 / purchase.amount_untaxed