Friday, April 5, 2024
2 changes
1 change
Resolved issues and error corrections
This fix ensures invoice and bill audit hashes are created in the correct chronological order, even when documents are sent or printed later. It also separates audit chains by invoice numbering prefix and warns accounting users when journal entries still need hashing, improving legal integrity reporting and reducing confusing audit results.
Original PR description
Entreprise PR: https://github.com/odoo/enterprise/pull/59243
1 change
Resolved issues and error corrections
The partner ledger report was consuming excessive memory when processing large numbers of partners, causing the system to crash with memory errors. This fix optimizes how partner data is retrieved and cached, reducing peak memory usage by approximately 32% (from 1.9GB to 1.3GB) when handling 150,000+ partner records.
Original PR description
Issue --> Method `_query_partners` does a search on `res.partner` which is used in the return value. This return value is then looped over in the method `_build_partner_dicts` to create the rows on the partner ledger. If the number of returned `res.partner` records exceed a certain number, there is an overutilzation of memory when getting fields id, name and trust in method `_get_report_line_partners` leading to a MemoryError when loading the partner ledger report. Solution --> Replace the `search` call with a `search_fetch` call and store the specific field values in cache. This prevents the fetch of the field values. Flamegraph before  After  Peak memory utilization reduced from 1.9GB to 1.3GB for about 150k `res.partner` records opw-3785731