Disabling the Location Mandatory field just resolves the error message and lets you post, but as a best practice, you should not be using the blank Location code if you have more than one Location (Location is essentially the Business Central terminology for a warehouse).
Only businesses that only have one warehouse and aren't planning on adding warehouses should allow the use of a blank value for Location Code for inventory related transactions. Even then, for future-proofing, I would suggest that the best practice is to create one Location code and use it (and enable the Location Mandatory field in Inventory Setup).
In a multi-warehouse scenario (typically, this is when you would need to transfer inventory from warehouse to another, or as Business Central calls it, from one location to another), it goes against best practice to allow the use of blank Location code. This is really why the Location Mandatory flag exists; The only reason why it may be acceptable to be transferring inventory from a blank Location code to a different Location code is because you started with one warehouse but didn't create a Location Code for it, and later decided to add more warehouses in Business Central and are trying to move out any remaining inventory from the blank Location code to the proper one. And once you are done, the next step you should take is to go to the Inventory Setup page and check the Location Mandatory field so no one accidentally uses the blank Location again.
I hope this helps. If my response has answered your question, please verify by clicking Yes next to "Did this answer your question?"