How do they manage to open a new route? For example Dubai-Panama. Do they have to open new airways?
No. You do not need to create new airways. You stick up to the already existent waypoints or not, if the route flies through a segment of free-route airspace.
Also, the engineering department of the airline studies the route, for instance: computes the MSA (Minimum Safe Altitude) for every point, engine failure and depressurization simulations are done in order to avoid possible hazards in critical points, if the aircraft is ETOPS certified they will decide which alternative airports are available for the route, fuel computations, chart generation for arrival and departure (most of the airlines use their own charts instead of those provided by the ANSP), et cetera.
Each airline has its own policy and the process may vary but fundamentally the procedure done is to make a study of all the parameters that can affect to guarantee safety and efficiency.
In addition to Airman01's answer, opening a route goes beyond flying from point A to point B, you also need to:
I forgot to mention that in the case of international flights, there's the issue of the Freedoms of the Air. Overflying, stopping, flying to, from or between countries other than your own is not automatic, and is usually subject to state-level agreements.
Overflying another country (First Freedom) is nearly universal (though the two states must either both be signatories of the IASTA, or have a bilateral agreement). The Wikipedia page on the topic also lists examples of flyover fees.
Further freedoms are a much more complex issue, though relatively recent changes like the EU–US Open Skies Agreement changed things a lot on many of the most competitive (and restricted) routes.
Maybe this is an exception which proves the rule, or maybe this is not exactly a valid answer because it doesn't relate to the design a new complete route, but sometimes new airway segments are created, e.g. this discussion between IATA and FAA for opening two new polar segments:
Summary of Discussions of the Sixteenth Meeting of the Cross Polar Trans East Air Traffic Management Providers Working Group (CPWG/16) 3-6 December 2013 – Ottawa, Canada
The routes were later discussed at ICAO, but seems to be still waiting for their implementation. However in the same document other routes are adjusted in the Sea of Japan: