Files
Odoo-18.0-20251222/account_financial_report/models
Akim Juillerat e9a88296ff Avoid error on installation with missing analytic account
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.
2024-11-29 15:38:41 +07:00
..