Retain Zero Qty Items in Inventory

On each inventory item, you can specify if you would like for that item to remain in your inventory after it is sold out and not be deleted. If an item is sold out (quantity becomes 0) and is set to be retained in your inventory then that item automatically becomes a stockroom item when it's sold.

You can choose to automatically delete 0 quantity stockroom items after a specified number of days of moving to stockroom in your Store Settings page.