[FIX] account.bank.statement: use correct sign for secondary currency amount when...
authorOlivier Dony <odo@openerp.com>
Thu, 4 Nov 2010 15:09:45 +0000 (16:09 +0100)
committerOlivier Dony <odo@openerp.com>
Thu, 4 Nov 2010 15:09:45 +0000 (16:09 +0100)
lp bug: https://launchpad.net/bugs/669903 fixed

bzr revid: odo@openerp.com-20101104150945-rj3ih8ru6j4bpu7z

addons/account/account_bank_statement.py

index 26ee33c..b6ff2c4 100644 (file)
@@ -225,13 +225,10 @@ class account_bank_statement(osv.osv):
 
                 if move.account_id and move.account_id.currency_id and move.account_id.currency_id.id <> company_currency_id:
                     val['currency_id'] = move.account_id.currency_id.id
-                    if company_currency_id==move.account_id.currency_id.id:
-                        amount_cur = move.amount
-                    else:
-                        amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
-                                move.account_id.currency_id.id, amount, context=context,
-                                account=acc_cur)
-                    val['amount_currency'] = amount_cur
+                    amount_cur = res_currency_obj.compute(cr, uid, company_currency_id,
+                            move.account_id.currency_id.id, amount, context=context,
+                            account=acc_cur)
+                    val['amount_currency'] = -amount_cur
 
                 torec.append(account_move_line_obj.create(cr, uid, val , context=context))