Daily updates from Odoo
Saturday, July 12, 2025
1 change · saas-18.3
Enhancements to existing features
Profit and Loss reports grouped by analytic accounts now avoid processing unnecessary empty analytic-plan entries. This reduces duplicated report data behind the scenes and can make large reports open about twice as fast in the benchmarked scenario.
Original PR description
Description ----------- For the P&L report, a view of the `account_analytic_line` is created to mascarade as `account_move_line` for the reporting engine. The `analytic_distribution` is takens from…
Description ----------- For the P&L report, a view of the `account_analytic_line` is created to mascarade as `account_move_line` for the reporting engine. The `analytic_distribution` is takens from the plans of the analytic lines. This is done by collecting all potential plans a line can be associated with and *unnesting* them into the main table. Unnesting creates a duplicate of the row for each possible value of the analytic plans. This can quickly balloon the row count of the view, depending on how many plans are present. This also creates a duplicate row when the line isn't associated with a specific plan, adding the value `NULL` for the `analytic_distribution`. This commits filters out the `NULL` values of the array of plans before unnesting into the main table. Since on average an analytic line is associated with a few plans, this prevents the significant growth of the view, leading to more reasonable performance. Benchmark --------- On a database with ~700k AAL and ~600k AML for 2025, opening the P&L report with a grouping by analytic accounts, took: | Accounts count | Before | After | |----------------|----------|----------| | 1 | 10.3 sec | 4.76 sec | | 5 | 51 sec | 20.8 sec | | 10 | 96 sec | 41.7 sec | | 15 | 2:26 min | 1:04 min | | 20 | 3:15 min | 1:25 min | So roughly a ~2x improvement on average. Reference --------- opw-4845164 Forward-Port-Of: odoo/enterprise#89630