Q:

Select top, random in env odoo

Is it possible in request env add "Select top" and "radndom" option?
test = http.request.env['my.test'].sudo().search([('type','=',1)])[0]

        return http.request.render('my_page', {'test': test})

I don't need return all data from database only top 10.

A:

You can try parameter limit, (and order parameter if needed) of search.
test = http.request.env['my.test'].sudo().search([('type','=',1)], limit=10)

