Tuesday, April 30, 2024
2 changes
Enhancements to existing features
This update fixes a critical memory issue that prevented users from viewing large stock location lists. By optimizing how the system loads inventory data, memory usage has been reduced by nearly 63% (from 1.6 GB to 600 MB), allowing the system to handle over 1.2 million inventory records without errors.
Original PR description
### Before this commit Can't navigate through the Locations list view as it would throw a Memory Error if too many stock.quants records. ### After this commit We prefetch only necessary fields to compute the value and the currency of the quants. ## Peak Memory Usage | stock.quants | Before | After | |-------------|---------|--------| | 1.2 million |1.6 GB | 600 MB | ## References opw-3887471 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Resolved issues and error corrections
Fixed a critical error that occurred when generating the Spanish Tax Report (Model 347) with large numbers of partners having small transactions. The issue happened because the system tried to process an extremely long list of excluded partners, causing the report to fail. The fix optimizes how excluded partners are handled, allowing the report to generate successfully even with thousands of partners.
Original PR description
Summary ----- When you try to display the spanish tax report, model 347, if you have too much partners with few small transactions (the sum is lower than 3005.06€), an error is raised. Steps to reproduce ----- 1. Install the l10n_es module 2. Create 30,000 invoices with an amount of 1€, and each having a distinct partner linked 3. Open the model 347: Accounting > Reporting > Tax Report, and select the report called "Tax Report (Mod 347)(ES)" and a date range large enough 4. Observe the very long UserError Cause ----- Too much partners must be excluded and the list of this partners are added to a domain which becomes very long and an error is raised when we use the function ast.literal_eval on it. Fix ----- The list of the excluded partners are passed in the "forced_domain" options. Like that, the ast.literal_eval function is not applied on it and the error is not raised. opw-3770944 Forward-Port-Of: odoo/enterprise#61452