=== modified file 'account/account_bank_statement.py' --- account/account_bank_statement.py 2013-04-18 10:24:33 +0000 +++ account/account_bank_statement.py 2013-04-28 06:26:37 +0000 @@ -55,9 +55,15 @@ def _end_balance(self, cursor, user, ids, name, attr, context=None): res = {} for statement in self.browse(cursor, user, ids, context=context): - res[statement.id] = statement.balance_start - for line in statement.line_ids: - res[statement.id] += line.amount + if statement: + res[statement.id] = statement.balance_start + for line in statement.line_ids: + res[statement.id] += line.amount + for line in statement.move_line_ids: + if line.credit > 0: + res[statement.id] -= line.credit + if line.debit > 0: + res[statement.id] += line.debit return res def _get_period(self, cr, uid, context=None):