Until this feature is added, a bookmarklet to toggle subtasks might help in the meantime: Introduction to Asana bookmarklets

If there are many subtasks in the project:
- Please scroll to the bottom of the project first to load all tasks
- It takes some time to click through all tasks, but it’ll be much faster (and easier) than manually clicking all expansion buttons