Error usually occurs when the Tax Code is not available or restricted to Sale transactions only.
1. Go to Setup > Accouting > Taxes > Tax Codes.
2. Click on Edit link for the Tax Code.
3. Under Available On field, check if it is currently set as Sales Transactions. Select both if necessary.
4. Click Save button.