Alan's relationship with Ms. McMartin may put Walden's adoption of Louis in jeopardy in the next episode of "Two and a Half Men" this Thursday.

Last week's episode, titled "For Whom the Booty Calls," began with a scene with Alan in bed with their social worker Ms. McMartin, played by actress Maggie Lawson. Apparently, the two have decided to maintain a causal sexual relationship, however Walden warned Alan that his romance with her could affect his ability to fully adopt his foster son Louis.

Later on in the show, Ms. McMartin suggested that Walden join a group for foster fathers, which allows him to spend time away from Alan. Walden immediately hit it off with the other members in the support group as they exchanged stories about their foster kids and complaints about their spouses.

However, Walden and Alan bumped heads when Walden invited his new friends over to his home to hang out. Walden asked Alan not to hang out with them, but Walden ended up spending time with them anyway. The two roommates then got into an argument when Walden told Alan that he wanted space. Eventually, they were able to work out their differences.

The synopsis for the upcoming episode, entitled "A Beer-Battered Rip-Off," reveals that Alan will decide to break up with Ms. McMartin in order to get back with his ex-girlfriend, Lyndsey, reports Carter Matt.

"When Alan breaks up with their social worker to get back together with Lyndsey, Walden worries it will affect Louis' adoption," reads the synopsis, according to AceShowBiz.com.

The episode will also feature actor Ed Forsyth, who will guest star as a waiter, reports The Hollywood Hills.

"Two and a Half Men" Season 12, Episode 12, " A Beer-Battered Rip-Off," airs on Thursday, Jan. 29, at 8 p.m. ET on CBS.