Skip to content

Commit

Permalink
[FIX] account_voucher: Refund payment: Error occurred while validatin…
Browse files Browse the repository at this point in the history
…g the field(s) amount_currency

https://launchpad.net/bugs/1181291
  • Loading branch information
eLBati authored and Stefan Rijnhart committed Jul 2, 2014
1 parent 060cfc3 commit 01985ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/account_voucher/account_voucher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,8 @@ def first_move_line_get(self, cr, uid, voucher_id, move_id, company_currency, cu
'period_id': voucher.period_id.id,
'partner_id': voucher.partner_id.id,
'currency_id': company_currency <> current_currency and current_currency or False,
'amount_currency': company_currency <> current_currency and sign * voucher.amount or 0.0,
'amount_currency': (sign * abs(voucher.amount)
if company_currency != current_currency else 0.0),
'date': voucher.date,
'date_maturity': voucher.date_due
}
Expand Down Expand Up @@ -1273,8 +1274,7 @@ def voucher_move_line_create(self, cr, uid, voucher_id, line_total, move_id, com
# otherwise we use the rates of the system
amount_currency = currency_obj.compute(cr, uid, company_currency, line.move_line_id.currency_id.id, move_line['debit']-move_line['credit'], context=ctx)
if line.amount == line.amount_unreconciled:
sign = voucher.type in ('payment', 'purchase') and -1 or 1
foreign_currency_diff = sign * line.move_line_id.amount_residual_currency + amount_currency
foreign_currency_diff = (line.move_line_id.amount_residual_currency - abs(amount_currency))

move_line['amount_currency'] = amount_currency
voucher_line = move_line_obj.create(cr, uid, move_line)
Expand Down

0 comments on commit 01985ac

Please sign in to comment.