Detecting battery module AVR removal
The circuit that you have shown will probably work for your purpose with some slight modifications.
1) Place a pull-down resistor on the gate of Q1, this way the gate will not be left floating it will have a well defined state when the module is unplugged.
2)I would place R1 on the drain of Q1, under the current configuration depending on the actual value of R1, Vcc and Vgs(threshold) of your device Q1 might end up in linear mode operation.