[FIX] account_voucher: wrong accounting entry for supplier payment in foreign currency

lp bug: https://launchpad.net/bugs/1007487 fixed

bzr revid: qdp-launchpad@openerp.com-20121010122008-sb3tgrccik1968ga
This commit is contained in:
Quentin (OpenERP)
2012-10-10 14:20:08 +02:00
parent 5e3836c604
commit aa4791450f
+2 -1
View File
@@ -1070,7 +1070,8 @@ class account_voucher(osv.osv):
if line.amount == line.amount_unreconciled:
if not line.move_line_id.amount_residual:
raise osv.except_osv(_('Wrong bank statement line'),_("You have to delete the bank statement line which the payment was reconciled to manually. Please check the payment of the partner %s by the amount of %s.")%(line.voucher_id.partner_id.name, line.voucher_id.amount))
currency_rate_difference = line.move_line_id.amount_residual - amount
sign = voucher_brw.type in ('payment', 'purchase') and -1 or 1
currency_rate_difference = sign * (line.move_line_id.amount_residual - amount)
else:
currency_rate_difference = 0.0
move_line = {