def post_init_hook(env): """Set Home Action to Projects for internal users that have none.""" action = env.ref("project.open_view_project_all", raise_if_not_found=False) if not action: return users = env["res.users"].search( [ ("share", "=", False), ("action_id", "=", False), ] ) if users: users.write({"action_id": action.id})