Donaldson led a quartet of qualifiers by winning the Thailand Golf Championship, the second event in The Open Qualifying Series, with France's Clement Sordet and 16-year-old Thai Phachara Khongwatmai also booking their spots.
Welshman Donaldson, who won the decisive match at last year's Ryder Cup, sealed a three-shot victory in Thailand with a seven-under-par closing round of 65.
Defending champion Westwood, from Worksop, finished tied in second place with Sordet and will make a 22nd consecutive appearance at The Open.
"It's great to get into The Open," he said. "It's my favourite championship of the year. I have played in every one since 1995 so it's nice to keep that run going.
"I've played at Royal Troon quite a few times and I finished fourth there one year. I like the golf course as it's a traditional links."
Khongwatmai came through the pre-qualifying event in Thailand and eventually finished sixth, but that was enough to earn him one of the four spots available because Sergio Garcia and An Byeong-hun, who finished in fourth and fifth, are already exempt.
The teenager said: "I am overwhelmed with happiness that I can be able to be included in The Open next year. I played with no expectations so I guess that was the key to playing well.
"I was already very happy to get a chance to play with the top stars this week. I didn't think so much and I surprised even myself to finish so well."