If Windows is set to Airplane Mode, this can prevent your battery from charging while in Airplane Mode, even after reboot or booting into Linux.
The change is persistent even when booting into Ubuntu–perhaps a no-battery-charge flag is set in the UEFI BIOS, at least on the Lenovo W540 & W541.
Laptop charge after Airplane Mode
You will have to go back into Windows and turn off Airplane Mode so that you can charge the battery.
The reason Lenovo gives for disabling battery charging in Airplane Mode is to avoid tripping the airplane seat power outlet circuit breaker. Seems fair, but they should have a popup message reminding you of this fact.