diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 2e5cdce5e84..4ed1219caaa 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -825,12 +825,17 @@ class account_move_line(osv.osv): total_amount_currency_str = rml_parser.formatLang(total_amount, currency_obj=line_currency) ret_line['credit_currency'] = actual_credit ret_line['debit_currency'] = actual_debit - ctx = context.copy() - if target_date: - ctx.update({'date': target_date}) - total_amount = currency_obj.compute(cr, uid, line_currency.id, target_currency.id, total_amount, context=ctx) - actual_debit = currency_obj.compute(cr, uid, line_currency.id, target_currency.id, actual_debit, context=ctx) - actual_credit = currency_obj.compute(cr, uid, line_currency.id, target_currency.id, actual_credit, context=ctx) + if target_currency == company_currency: + actual_debit = debit + actual_credit = credit + total_amount = debit or credit + else: + ctx = context.copy() + if target_date: + ctx.update({'date': target_date}) + total_amount = currency_obj.compute(cr, uid, line_currency.id, target_currency.id, total_amount, context=ctx) + actual_debit = currency_obj.compute(cr, uid, line_currency.id, target_currency.id, actual_debit, context=ctx) + actual_credit = currency_obj.compute(cr, uid, line_currency.id, target_currency.id, actual_credit, context=ctx) amount_str = rml_parser.formatLang(actual_debit or actual_credit, currency_obj=target_currency) total_amount_str = rml_parser.formatLang(total_amount, currency_obj=target_currency)