I have seen on some airlines that when one of the pilots has to leave the cockpit they require a cabin attendant to take their place in the cockpit to answer the door. That leaves the remaining pilot to handle the controls, without having to deal with the door at all.
Most modern airliners are electric doors with a pilots over ride switch on their center console that has a 5 minute or 20 minute time limit that the over ride can’t be bypassed by the code keypad on the outside of the door......
Airbus has such versus having to leave the controls to go open the door.....
Stay Safe !!