From 745e4426b4c77c91b2b83d742e5c2ce0c06601fd Mon Sep 17 00:00:00 2001 From: Nicolas Bustillos Date: Tue, 23 Jun 2015 00:40:19 -0400 Subject: [PATCH] [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 --- addons/account_voucher/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 0fa420f4ac0..7c7a6215812 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -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