Sales invoice and Quantity

Sales invoice cannot be created or saved if the quantity is not available, Or show a warning message

Is there a script?

Refer to this :
ERPNext Stock Settings

You can enable / disable Allow Negative Stock globally instead of enable it for specific items.