[FIX] account: reconciliation: taking into account that amount_residual can (very infrequently) be < 0

This commit is contained in:
Arthur Maniet 2014-09-10 17:07:07 +02:00
parent e49eeded39
commit 1cd330f7ef
1 changed files with 6 additions and 0 deletions

View File

@ -816,6 +816,12 @@ class account_move_line(osv.osv):
credit = currency_obj.compute(cr, uid, target_currency.id, company_currency.id, credit, context=ctx)
amount_str = rml_parser.formatLang(debit or credit, currency_obj=target_currency)
# Amount residual can be negative
if debit < 0:
debit, credit = credit, -debit
if credit < 0:
debit, credit = -credit, debit
ret_line['credit'] = credit
ret_line['debit'] = debit
ret_line['amount_str'] = amount_str