Fix stock logic in 2.2 for variations with parents which manage stock

Closes #5957 @claudiosmweb can you review this change?