I have the same problem with Macbookpro 10,2 Retina (13inch) Late 2012.
Bought a A1437 battery from an online retailer. I requested a laptop shop (advertised as a laptop expert) to install as I do not have proper tools and the new battery did not come with any. For 4 days, a few technicians were scratching their heads on why my machine completely shutdown everytime the Magsafe plug was disconnected. They tried swapping with a known good battery, clearing SMC, NVRAM. Finally, I was told that my motherboard is the problem and will cost $$$. I decided that it was not worth throwing good money. So I retrieved my laptop from them. They did not billed me.
I am sure the sequence is as follows
<REPEATING only 1 of Alexandre's steps below>
(Assuming that your macbookpro can still be powered up directly from power adapter.
1. Make sure that your macbookpro is shutdown completely.
2. Connect the Magsafe plug to your macbookpro.
3. Press the button and be very patient. Briefly, the Apple logo is displayed.
(I noticed that the battery status did momentarily showed 100% on logon screen )
4. Login to your account. Magsafe started to display Orange when I login.
5. Battery initially showed 34% charge. I installed free battery meter from http://www.coconut-flavour.com/coconutba... and waited longer. 2 hours later, charge showed 100%. 80% is recommended.
6. I unplug the Magsafe plug and my machine worked fine on battery power.
Coconut battery showed my new battery had cycled 4 times. I think the cycle was caused by the technician.
David - Sydney, Australia