diff options
| author | Daniel Dico <dd@oerp.ca> | 2014-07-22 16:17:46 -0400 |
|---|---|---|
| committer | Martin Trigaux <mat@openerp.com> | 2014-07-23 11:19:41 +0200 |
| commit | 42f3575bb3fdc6c0b2a5c43685d7bd99d771f2fd (patch) | |
| tree | 055ecab481bb715c5af7f89488cc37bf23209b78 | |
| parent | e9c92b57b9237f4c13e23264692b6de3ecbad935 (diff) | |
[FIX] account: Bank Statement reconcilation with different currency
When generating reconciled moves in bank statement, use the amount_currency field instead of amount for currency conversion.
Otherwise we would endup with moves with an amount of 0.
| -rw-r--r-- | addons/account/account_bank_statement.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 4eb0d6cd552..4d9c3f3efbd 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -738,9 +738,12 @@ class account_bank_statement_line(osv.osv): move_id = am_obj.create(cr, uid, move_vals, context=context) # Create the move line for the statement line - ctx = context.copy() - ctx['date'] = st_line.date - amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount, context=ctx) + if st_line.statement_id.currency.id != company_currency.id: + ctx = context.copy() + ctx['date'] = st_line.date + amount = currency_obj.compute(cr, uid, st_line.statement_id.currency.id, company_currency.id, st_line.amount_currency, context=ctx) + else: + amount = st_line.amount bank_st_move_vals = bs_obj._prepare_bank_move_line(cr, uid, st_line, move_id, amount, company_currency.id, context=context) aml_obj.create(cr, uid, bank_st_move_vals, context=context) # Complete the dicts |
