Daily updates from Odoo
Tuesday, July 16, 2024
2 changes · 17.0
Enhancements to existing features
This update improves the performance of the Spanish Model 347 tax report, especially when dealing with large numbers of partners. Instead of processing a potentially massive list of partner IDs, the system now uses a more efficient database query approach that significantly speeds up report generation and prevents slowdowns.
Original PR description
The model 347 report is adding a partner exclusion domain in the search call. It is done by firstly retrieving those partner IDs to then add that list of IDs into a `not in` domain leaf. The issue is…
The model 347 report is adding a partner exclusion domain in the search call. It is done by firstly retrieving those partner IDs to then add that list of IDs into a `not in` domain leaf. The issue is that the list of IDs can be gigantic, leading to performance issues. Before odoo/enterprise#61452, it was a blocking issue as if the list was too long (100,000 IDs raise the issue), it would simply make the code crash when loading the report. That PR then simply bypassed the issue by passing the domain as `forced_domain` so it would not go through the `literal_eval()` call (which is the one crashing when the list is too long). But even after that fix, we still provide the list of IDs into the domain and so ultimately in the SQL request, which can still be an issue if there are too many. This commit improves that by passing the SQL subquery (the one fetching the partners to exclude) directly into the domain, so the SQL query won't contain any list of IDs but just a sub-select. It does have better performance within PostgreSQL for big lists. Note that the `SQL()` query is surrounded by parentheses on purpose, as it doesn't work otherwise. This might be improved at the ORM level in the future with odoo/odoo#163560. Task [link](https://www.odoo.com/web#model=project.task&id=3895983) task-3895983
The shop floor app now includes a pager that allows users to navigate through all available work orders, not just the first 40. The pager only appears when needed and lets users adjust how many records they view at once, making it clearer when they're viewing a subset of available data.
Original PR description
In [1], a limit was introduced to the amount of records that can be displayed at the same time in the shop floor app. However, it was not always very clear to the user that they may only be viewing a subset of the available records. It was also impossible to show any records beyond the first 40 that conform to the filter criteria. In this commit, we introduce a pager to resolve these issues. The pager will only be displayed when relevant (ie when not all available records are displayed). Using this new pager it is also possible for the user to dynamically increase or decrease the default limit of 40, which was not possible before. [1] https://github.com/odoo/enterprise/pull/64551 (and forward ports)