[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-26 08:32:53 +02:00
committed by Nicolas Martinelli
parent 36c283fec1
commit 745e4426b4
+1 -1
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