For starters, I don't see why Detroit would want Hayward. If he stays healthy and plays well, he elects for FA. If he continues along at his current pretty good, with some durability concerns, he opts in and you over pay him next season.
I would be fine with this trade for the Celtics though. I think it would make the Celtics better this year and likely no different after that as I doubt we resign Hayward and as I said above, we may not even want him back at $34M. We role the dice with Rose for two seasons and get what we can out of him in exchange for a pick that isn't that great anymore.