While the stock market has surged to record highs in 2016, shares of Boeing (BA -0.24%) have been held down by widespread worries about slowing aircraft demand. Indeed, with the end of September quickly approaching, Boeing is less than halfway to its full-year goal for aircraft orders.

BA Chart

Boeing vs. S&P 500 2016 Stock Performance, data by YCharts.

Order activity for the 777 widebody family has been particularly disappointing this year. Moreover, the backlog for this cash cow is disappearing quickly, which makes the task of finding new orders especially pressing. Fortunately, Boeing moved closer to finalizing two important 777 orders last week.

777 sales in focus

Over the next several years, Boeing will transition from the 777 to the next-generation 777X. However, the 777X won't arrive until 2020, and production of that new model won't fully ramp up until a couple of years later.

Boeing must sell enough 777s to bridge the gap until 777X production reaches full speed. However, the fact that the current-generation 777 is about to be supplanted by a new model makes that quite challenging. In January, Boeing announced plans to cut 777 production from 8.3 per month to seven per month at the beginning of 2017 to cope with the resulting order slowdown.

Boeing is having trouble keeping its 777 factory busy. Image source: Boeing.

To continue at that rate through the model transition, Boeing has said that it needs to garner 40-50 777 orders per year for the next few years. Increasingly, many analysts think that Boeing will have to slash 777 production even further. The reason? Boeing has logged just eight net orders for the 777 so far in 2016. Thus, Boeing desperately needs to finalize more orders in the next few months.

New order from Saudi Arabia

Last Friday, Saudi Arabian Airlines -- also known as Saudia -- announced plans to acquire 63 new aircraft: 28 widebodies from Boeing and 35 narrowbodies from Airbus. The Boeing order includes 15 777-300ERs, as well as 13 787 Dreamliners.

Saudia already operates more than four dozen 777s, including 24 777-300ERs. The new planes for this important Boeing customer will most likely be used for a combination of growth plus replacement of aging 747 jumbo jets.

Boeing hasn't officially announced the Saudia deal yet. However, it doesn't face any major obstacles to wrapping up this vital order.

Some progress on Iran?

Two days before the Saudia order announcement, Boeing got some good news about its pending order from Iran Air, as the U.S. Treasury Department approved export licenses for 80 Boeing planes. This gets Boeing one step closer to finalizing a tentative deal that includes 15 777-300ERs.

However, the Iran aircraft sale is far from being a done deal. The U.S. rapprochement with Iran that would enable Boeing to do business with Iranian companies has been viciously opposed by nearly all of the Republican Party.

If Hillary Clinton wins the upcoming presidential election, there is a good chance that Boeing will be able to finalize the Iran Air order later this year. (That said, lining up financing remains a significant obstacle.) On the other hand, if Donald Trump wins, his administration would likely slap tougher sanctions on Iran and force Boeing to drop the deal.

Boeing needs these deals

On paper, Boeing looks like it is miles away from meeting its 2016 order target for the 777. But if it can finalize the Saudia and Iran Air orders before year-end, it will have brought in 38 net orders for the current-generation 777: close to the goal of 40-50 net orders.

Boeing CEO Dennis Muilenberg has hinted that if the company can't close more 777 sales by the end of the year, it will have to make deeper production cuts (i.e., below the planned seven-per-month rate). That would represent a significant drag on earnings and cash flow.

Boeing's chances of avoiding -- or at least delaying -- these potential production cuts look a lot better than they did a week ago. Moreover, Boeing still has three months left in the year to pursue additional 777 sales and (hopefully) solidify its production plans.