Daily updates from Odoo
Monday, November 20, 2023
2 changes
Resolved issues and error corrections
A bug was causing the bank statement reconciliation process to run repeatedly in an endless loop. The issue occurred because a counter that tracks reconciled transactions was being incorrectly incremented even when no transactions were actually reconciled. This fix ensures the counter only increases when transactions are genuinely processed, preventing the unnecessary repeated execution.
Original PR description
Issue: When no statement lines were auto reconciled, the false increment of counter variable to update the count of number of reconciled lines causes the cron to execute infinite time as it triggers the same cron by checking the same counter variable. This regression is mainly caused by the commit 0d7d1a2 where some statements were moved inside try...catch statement but forgot to move the counter variable along with it. As a result, it could falsely increment the counter variable when the UserError exception raises. Fix: Updated the reconciled line count variable when some lines were actually reconciled. Forward-Port-Of: odoo/enterprise#50416 Forward-Port-Of: odoo/enterprise#50268
This update resolves memory errors that occurred when viewing large project timelines in the Gantt View, particularly when tasks contain images. The fix optimizes how data is loaded from the database, reducing memory usage from 2GB to 500MB in typical scenarios. This allows users to work with larger projects without system crashes.
Original PR description
When loading up the GanttView from Field of Service and switching to "Year", the number of tasks to load can be quite big. If these tasks' description contains images, it's very likely that a…
When loading up the GanttView from Field of Service and switching to "Year", the number of tasks to load can be quite big. If these tasks' description contains images, it's very likely that a MemoryError will be raised. To avoid that, turn off field prefetching in `_compute_leave_warning` and `_gantt_progress_bar_user_ids` and then use `read` to prefetch all needed fields at once. Because `read` (as oppose to `fetch` in saas-16.2 up) does not check the cache, the query count in `test_performance` has to be increased from 9 to 10, even though creating new tasks inside this test puts their fields' value in cache. Browsing for self.ids prevents AccessErrors with NewIds that don't have values in database yet. But they do in cache so the following calls to `__get__` will simply return the values from the field cache. So no additionnal queries from turning off prefetching in that case. Ideally, the calls to `read` should be replaced by calls to `fetch` from 16.2 up. #### Benchmark In a customer database with 2600 project.task for the current year, loading up the GanttView goes from 2Gb (MemoryError raised) to 500Mb (no MemoryError raised).   Forward-Port-Of: odoo/enterprise#50756 Forward-Port-Of: odoo/enterprise#48912