By default, if an invalid stock code, description, etc. is typed, when selecting a stock item on the Stock lookup, a confirmation message to create a new stock item will be displayed. 

If you click on the Yes button, you may first create the item and then return to continue with processing the document. To turn this feature off, select (tick) the "Cannot create items" option.