'To pick a random product from the selected suppliers, and create an order with this one'

@api.multi
def random_pick(self):

    self.ensure_one()
    if self.is_max_budget:
        products_obj = self.env['lunch.product'].search([('supplier', 'in', self.supplier_ids.ids), ('price', '<=', self.max_budget)])
    else:
        products_obj = self.env['lunch.product'].search([('supplier', 'in', self.supplier_ids.ids)])
    if (len(products_obj) != 0):
        random_product_obj = self.env['lunch.product'].browse([random.choice(products_obj.ids)])
        order_line = self.env['lunch.order.line'].create({'product_id': random_product_obj.id, 'order_id': self._context['active_id']})
    else:
        raise UserError(_('No    product    is    matching    your    request.    Now    you    will    starve    to    death.'))
