The option to prevent from issuing sales receipt when the product is out of stock isn't possible. As a workaround, you can set up reorder points to alerts you on what's running low and what's out of stock. Here's how:
Go to Settings and select Products & services.
Find the product you want to have a reorder point.
Click Edit in the Action column.
In the Reorder point field, add the threshold when you should reorder more stock and hit Save.
Additionally, you can look for a third-party app that would suit your needs regarding your inventory.