[FIX] account_voucher: writeoff amount on unreconciled amount instead of price to allow negative writeoff (eg: negative currency change rate difference) (opw #593977)

bzr revid: mat@openerp.com-20130723141734-8wtbyn4ubz8rwfj1
This commit is contained in:
Martin Trigaux 2013-07-23 16:17:34 +02:00
parent b69a97f2af
commit 3b61eb8627
1 changed files with 2 additions and 2 deletions

View File

@ -236,9 +236,9 @@ class account_voucher(osv.osv):
debit = credit = 0.0
sign = type == 'payment' and -1 or 1
for l in line_dr_ids:
debit += l['amount']
debit += l['amount_unreconciled']
for l in line_cr_ids:
credit += l['amount']
credit += l['amount_unreconciled']
return amount - sign * (credit - debit)
def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount, voucher_currency, type, context=None):