Pedro Manuel Baeza has proposed merging 
lp:~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign 
into lp:account-payment/7.0.

Requested reviews:
  Account Payment (account-payment-team)

For more details, see:
https://code.launchpad.net/~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign/+merge/192373

[FIX] account_payment_extension: Correct sign for amount and amount_currency 
when adding lines manually in a receivable payment order.
-- 
https://code.launchpad.net/~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign/+merge/192373
Your team Account Payment is requested to review the proposed merge of 
lp:~pedro.baeza/account-payment/7.0-account_payment_extension-fix-amount-sign 
into lp:account-payment/7.0.
=== 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 @@
             if line.name != '/':
                 result['value']['communication'] = result['value']['communication'] + '. ' + line.name
             result['value']['account_id'] = line.account_id.id
+            if context.get('order_id'):
+                payment_order = self.pool.get('payment.order').browse(
+                    cr, uid, context['order_id'], context=context)
+                if payment_order.type == 'receivable':
+                    result['value']['amount'] *= -1
+                    result['value']['amount_currency'] *= -1
         return result

-- 
Mailing list: https://launchpad.net/~account-payment-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~account-payment-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to