New installation was detected using the `installed_version` attribute
(`latest_version` in `ir_module_module` table), but this field wasn't
reset at module uninstallation (now fixed by cb29f9ef) avoiding
execution of hooks.
Same logic was applied for migration scripts at 8ff7230e.
Fixes #7708