If the power connector disconnects the batteries as the plug is inserted you don't need a diode.
The problem with these is that if the power goes off the batteries cannot supply power.
A solution where you use a switched plug as well as a diode allows for uninterrupted power as you insert/remove the plug, or have a power failure, combined with eliminating the losses from the diode when the external supply is not connected.