Make sure to associate newly built inventory units to their order
Fixes #5088