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
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
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
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve
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.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

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