Small fix when we close the app Stock with an open inventory

Change-Id: Ic052e5a2217f4f3cd121d3e08236457c35ab4872