[FIX] account_voucher: reset amounts to zero when looping over many voucher's writeoff_amount

When column 'writeoff_amount' gets displayed on a tree view and function
_get_writeoff_amount() is called with multiple ids, the returned amounts keeps
getting bigger every row.

Closes #7211
This commit is contained in:
Nicolas Bustillos 2015-06-23 00:40:19 -04:00 committed by Nicolas Martinelli
parent 36c283fec1
commit 745e4426b4
1 changed files with 1 additions and 1 deletions

View File

@ -226,8 +226,8 @@ class account_voucher(osv.osv):
if not ids: return {}
currency_obj = self.pool.get('res.currency')
res = {}
debit = credit = 0.0
for voucher in self.browse(cr, uid, ids, context=context):
debit = credit = 0.0
sign = voucher.type == 'payment' and -1 or 1
for l in voucher.line_dr_ids:
debit += l.amount