Cannot import name 'get_affected_transactions'

Anyone receiving the

cannot import name ‘get_affected_transactions’

error while Cancelling a Purchase Invoice?

Looks like an incorrectly applied update. Do a bench restart to reload changed code in web/background workers.