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.
Make my laptop charge again!
You will have to go back into Windows and turn off Airplane Mode so that you can charge the battery.
The reason Lenovo gives is this is a convenience so that you don’t trip the airplane seat power outlet circuit breaker. Seems fair, but they should have a popup message reminding you of this fact.