Answer: no, but a free passage of at least 50 to 70 cm is necessary.
There is no regulatory distance to respect between a water heater and an electrical panel, it is just necessary that the water heater does not hinder access to the electrical panel. So this requires a free passage of at least 50 cm or 70 cm to allow intervention on the board, by yourself or by an outside technician. In the end, it is above all a question of common sense. For more security, you can always install a watertight partition between the two, just to ward off any eventuality, but again nothing essential.The only real obligation concerning the electrical panel is that it must be placed at a height included between 0.90 m and 1.80 m from the finished floor, a little less in a housing suitable for disabled people.