In 2006, when Rob Reiner was shooting “The Bucket List” with Jack Nicholson and Morgan Freeman, he got the idea for another project — a feature dealing with people falling in love later in life.

Eight years later, Reiner’s “And So It Goes” is up for sale at Berlin. Produced by Foresight Unlimited in association with Reiner’s Castle Rock, it marks the first time Michael Douglas and Diane Keaton have appeared onscreen together.

Douglas portrays a self-centered real estate agent whose life is turned upside down when his estranged son suddenly drops off a granddaughter, played by Sterling Jerins, whom he never knew. Keaton plays the neighbor of Douglas’ character. The cast is rounded out by Frankie Valli, Scott Shepherd and Frances Sternhagen.

“We really thought about getting Jack (Nicholson) in the film but he really does not want to act any more,” Reiner said.

Reiner notes that recent films aimed at the older audience — “It’s Complicated,” “The Best Exotic Marigold Hotel,” “Hope Springs,” “Last Vegas” — have succeeded partly because the target demographic is willing to go out to a theater to see them.

“We know that this is an audience that actually goes to the movies,” he said.

Reiner admitted that “And So It Goes” returns to the themes of several of his previous films such as “When Harry Met Sally” and “The Sure Thing.”

“In all my movies about men and women, the women are always more mature and the turning point is when the guys realize that,” he noted. “There’s also the thrill of the first time people realize that they really like each other, which is still just like when you’re a teenager.”

For his next film, he’s planning to direct the thriller “You Belong to Me” and developing Carl Hiassen’s “Basket Case” as a scripted project for Spike TV, following an investigative reporter demoted to the obits desk, which provides a new perspective into crime-ridden Miami.