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: