Fix error while saving related model without file

Without that change, related model loose all your data.