If you upgrade your database to NAV2016 using the PowerShell Merge commandlets and have a change to table 49 you will run into this issue.
Table 49 is the Invoice Posting Buffer table that NAV uses to create G/L entries for each unique combination of values in the Sales and Purchase documents. With the NAV2016 release Microsoft have added the Deferral Code field to this table and the primary key.