diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 541702dccb4..be2e61060a3 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -964,11 +964,11 @@ class account_bank_statement_line(osv.osv): return res def _check_amount(self, cr, uid, ids, context=None): - obj = self.browse(cr, uid, ids[0]) - if obj.voucher_id: - if not (obj.amount == obj.voucher_id.amount): - return False - return True + for obj in self.browse(cr, uid, ids): + if obj.voucher_id: + if not (obj.amount == obj.voucher_id.amount): + return False + return True _constraints = [ (_check_amount, 'The amount of the voucher must be the same amount as the one on the statement line', ['statement_id']),