Daily updates from Odoo
Monday, March 2, 2026
1 change
Resolved issues and error corrections
This update resolves a significant performance issue that caused slow loading times (80+ seconds) and memory errors when accessing key reports like 'Invoices to be Issued' and 'Invoiced Not Delivered'. The fix optimizes the data retrieval process, dramatically reducing load times to just 8.5 seconds and eliminating memory errors on large databases.
Original PR description
### Problem Opening the "Invoices to be Issued" and "Invoiced Not Delivered" menus caused MemoryErrors and 80+ second load times on large databases. ### Root Cause `_read_group_for_accrual` loops…
### Problem
Opening the "Invoices to be Issued" and "Invoiced Not Delivered" menus
caused MemoryErrors and 80+ second load times on large databases.
### Root Cause
`_read_group_for_accrual` loops over each group result to manually sum
non-stored computed fields. On each iteration it called `search()` with
a domain containing `('invoice_to_be_issued', '=', True)`, triggering
`_get_accrual_line_ids` once per group instead of once per request.
### Fix
Move the `search()` call outside the loop so matching records are fetched
once per request. The per-group partition is then resolved using
`search_fetch` + `grouped`, which handles the field prefetching and
grouping into recordsets in one call.
### Before / After
| Metric | Before | After |
|-------------------------------|---------|--------|
| Total request time | 82s | 8.5s |
| `_get_accrual_line_ids` calls | 82 | 3 |
| MemoryError on large DBs | ✓ | ✗ |
opw-5392606
Forward-Port-Of: odoo/enterprise#108102