From 86a0d31251a701da8bd1dbcb5580b958d932b33a Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 7 Jun 2017 13:29:58 +0200 Subject: [PATCH] [FIX] account: Validating a statement with old posted moves When validating a statement with old posted moves, the lock date was checked by function, _check_lock_date and then it was impossible to validate the statement even if all the moves were already posted. --- addons/account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 857ffc3e71d..1728aecbe33 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -241,7 +241,7 @@ class AccountBankStatement(models.Model): for aml in st_line.journal_entry_ids: moves |= aml.move_id if moves: - moves.post() + moves.filtered(lambda m: m.state != 'posted').post() statement.message_post(body=_('Statement %s confirmed, journal items were created.') % (statement.name,)) statements.link_bank_to_partner() statements.write({'state': 'confirm', 'date_done': time.strftime("%Y-%m-%d %H:%M:%S")})