When ticking "Update Using Customer Deparmtent" in Settings > Invoice and order defaults > Update ledgers, this will make any invoice you enter update to the ledgers using that department code.
If you then create a product invoice and need to change it via the edit item line window and update the ledgers it uses this new, edited department. However that doesn't do the same for a service invoice, you had to update it and then edit the transaction to show the department.