Merge lp:~yann-papouin/ocb-addons/6.1-bug-1077931-fix-purchase-invoiced-rate into lp:ocb-addons/6.1

Proposed by Yann Papouin
Status: Merged
Merged at revision: 6844
Proposed branch: lp:~yann-papouin/ocb-addons/6.1-bug-1077931-fix-purchase-invoiced-rate
Merge into: lp:ocb-addons/6.1
Diff against target: 16 lines (+2/-2)
1 file modified
purchase/purchase.py (+2/-2)
To merge this branch: bzr merge lp:~yann-papouin/ocb-addons/6.1-bug-1077931-fix-purchase-invoiced-rate
Reviewer Review Type Date Requested Status
Ana Juaristi Olalde (community) code review Approve
Pedro Manuel Baeza code review Approve
Omar (Pexego) code review Approve
Stefan Rijnhart (Opener) code review Approve
Guewen Baconnier @ Camptocamp Needs Information
Holger Brunn (Therp) code review Approve
Review via email: mp+205145@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

The original proposal has been changed: https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-581957-rha/+merge/135880

Can you check that?

Thanks

review: Needs Information
Revision history for this message
Yann Papouin (yann-papouin) wrote :

No changes for me, It's just my merge proposal that add a limit to 100% to the rate value

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Tnx!

review: Approve (code review)
Revision history for this message
Omar (Pexego) (omar7r) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Guewen, could you please check your MP review?

I see OK to add extra clamp on bar percentage, and it doesn't see that OpenERP S.A. it's going to merge OPW branch.

Regards.

review: Approve (code review)
Revision history for this message
Ana Juaristi Olalde (ajuaristio) :
review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

I proceed with the merge, because Guewen's question is answered.

Regards.

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 2013-11-20 01:17:39 +0000
3+++ purchase/purchase.py 2014-02-06 12:31:06 +0000
4@@ -90,10 +90,10 @@
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[purchase.id] = tot * 100.0 / purchase.amount_untaxed
13+ res[purchase.id] = min(100.0, tot * 100.0 / purchase.amount_untaxed)
14 else:
15 res[purchase.id] = 0.0
16 return res

Subscribers

People subscribed via source and target branches