'Returns the hash to write on journal entries when they get posted'

def _get_new_hash(self, secure_seq_number):

    self.ensure_one()
    prev_move = self.search([('state', '=', 'posted'), ('company_id', '=', self.company_id.id), ('l10n_fr_secure_sequence_number', '=', (int(secure_seq_number) - 1))])
    if (prev_move and (len(prev_move) != 1)):
        raise UserError(_('Error    occured    when    computing    the    hash.    Impossible    to    get    the    unique    previous    posted    move'))
    return self._compute_hash((prev_move.l10n_fr_hash if prev_move else ''))
