'Returns warehouse id of warehouse that contains location'

@api.multi
@api.returns('stock.warehouse', (lambda value: value.id))
def get_warehouse(self):

    return self.env['stock.warehouse'].search([('view_location_id.parent_left', '<=', self.parent_left), ('view_location_id.parent_right', '>=', self.parent_left)], limit=1)
