Sounds like my Traveler. Needs to move around to get a movement
I haven't bothered to train him not to go on walks but I didn't want to be dodging land mines when I walk in my yard so I have trained him to go only in one area in our backyard.
I had success doing this by putting a very short leash on his collar before going out to play in the yard. After some time, I could see by his body language that he was sniffing around for the perfect poo spot. At that point I would use the short leash to bring him into the area I wanted. Sounds dumb but my command was "PeePee PooPoo HERE!" when we got to that section of the yard. I treat after he went and playtime after that.
The best part of this whole lesson is that now I can almost always get him to pee and poo on command.