While not official policy, AS is pretty good about crediting one partner's codeshare on another partner's medal if you send in your boarding passes after the fact. It worked for me for a couple of DL-coded KL flights last year, and I have an AA codeshare on BA metal coming up next month that I'm counting on credit from as well. But buying from BA is technically the only way to be POSITIVE you'll get the miles.
Also, keep in mind that AS is running a double RDM promo on BA SEA-LHR right now. I'd guess that they'd still honor that if you bought the ticket from AA, but if you just buy from BA it's a certainty.