When installing the module account_financial_report, a relational table between
account_move_line and account_analytic_account is created and computed.
However, if an analytic account was used only on draft invoices before being deleted,
its ID will remain in the JSON column analytic_distibution of account_move_line.
In that case we get a ForeignKeyViolation because the ID doesn't exist in
account_analytic_account table.
Therefore, we need to check if the ID exists during the computation to avoid
inserting it in the relational table and raising the error.