[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.
Backport of this commit: 86a0d31251
opw:1830804
This commit is contained in:
@@ -247,7 +247,7 @@ class AccountBankStatement(models.Model):
|
||||
raise UserError(_('All the account entries lines must be processed in order to close the statement.'))
|
||||
moves = (moves | st_line.journal_entry_ids)
|
||||
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")})
|
||||
|
||||
Reference in New Issue
Block a user