Merge lp:~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign into lp:~account-payment-team/account-payment/7.0

Proposed by Pedro Manuel Baeza on 2013-10-23
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp on 2014-01-31
Approved revision: 103
Merged at revision: 107
Proposed branch: lp:~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign
Merge into: lp:~account-payment-team/account-payment/7.0
Diff against target: 14 lines (+6/-0)
1 file modified
account_payment_extension/account_payment.py (+6/-0)
To merge this branch: bzr merge lp:~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp code review, no tests Approve on 2014-01-31
Maxime Chambreuil (http://www.savoirfairelinux.com) code review 2013-10-23 Approve on 2013-12-27
Review via email: mp+192373@code.launchpad.net

Description of the change

[FIX] account_payment_extension: Correct sign for amount and amount_currency when adding lines manually in a receivable payment order.

To post a comment you must log in.
review: Approve (code review)

LGTM

review: Approve (code review, no tests)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_payment_extension/account_payment.py'
--- account_payment_extension/account_payment.py 2013-09-24 15:15:21 +0000
+++ account_payment_extension/account_payment.py 2013-10-23 17:35:00 +0000
@@ -384,4 +384,10 @@
384 if line.name != '/':384 if line.name != '/':
385 result['value']['communication'] = result['value']['communication'] + '. ' + line.name385 result['value']['communication'] = result['value']['communication'] + '. ' + line.name
386 result['value']['account_id'] = line.account_id.id386 result['value']['account_id'] = line.account_id.id
387 if context.get('order_id'):
388 payment_order = self.pool.get('payment.order').browse(
389 cr, uid, context['order_id'], context=context)
390 if payment_order.type == 'receivable':
391 result['value']['amount'] *= -1
392 result['value']['amount_currency'] *= -1
387 return result393 return result