The goal of this commit is to fix the race condition introduced by [this commit]. Here were the problematic steps: - Open the mega menu. - When then mega menu is opened, scroll up. - Open the mega menu after scroll. Before this commit, what could happened was that the mega menu did not have enough time to be closed after the scroll. Clicking on it would then actually close it rather than open it as wanted. This commit adds a step to ensure that the mega menu is closed before open it. [this commit]: https://github.com/odoo/odoo/commit/9b1de9e28697edbb6e1fa88665294f983f60e37f runbot-20660 closes odoo/odoo#119438 X-original-commit: abd0038de73a057eb9c34dc8d316b67d96fac409 Signed-off-by: Romain Derie (rde) <rde@odoo.com>