From 549ea7a886ac45f84a3951006ecb774c1c8b5d23 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Tue, 5 Jul 2016 11:27:56 +0200 Subject: [PATCH] [FIX] account: cancelling a statement line that was reconciled with several already registered payment was crashing. Fixes opw 680128 --- addons/account/models/account_bank_statement.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 140ca5dc5c0..943beb0b285 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -432,7 +432,8 @@ class AccountBankStatementLine(models.Model): moves_to_cancel |= st_line.journal_entry_ids if moves_to_unbind: moves_to_unbind.write({'statement_line_id': False}) - moves_to_unbind.line_ids.filtered(lambda x:x.statement_id == st_line.statement_id).write({'statement_id': False}) + for move in moves_to_unbind: + move.line_ids.filtered(lambda x:x.statement_id == st_line.statement_id).write({'statement_id': False}) if moves_to_cancel: for move in moves_to_cancel: