Sales Invoice for StockQty=0

I am facing the scenario where I am able to create a Sales Invoice for an item whose StockQty = 0. This does not seem right to me. I am not using Offline mode. Is there a way to prevent this? I should only be able to see items which have StockQty > 0 in POS. Please advise.

Please don’t forget to search forum prior to creating new topics. Better to continue discussion in already existing thread: POS allow to sale items with stock zero?
Reference issue: POS: No warning message on stock zero · Issue #10683 · frappe/erpnext · GitHub