Wednesday, June 26, 2024
4 changes
Code cleanup and technical improvements
The spreadsheet selection dialog was redesigned so different spreadsheet areas can share the same experience without custom front-end work each time. This makes it easier and safer to add new spreadsheet-related features in Documents and Dashboards while keeping the user experience consistent.
The spreadsheet editing module’s automated tests were reorganized and converted to a newer testing framework. This is an internal quality improvement that helps maintain reliability while preserving legacy support needed by related modules.
Original PR description
This commit converts the tests of the spreadsheet_edition module to Hoot. Some legacy helpers are kept because they are used in other modules. Task: 4011296
Gantt views now load unavailability information together with the main schedule data instead of making extra back-and-forth requests. This streamlines scheduling screens across appointments, planning, HR, projects, manufacturing, and related areas, improving maintainability and likely responsiveness without changing the core user workflow.
A spreadsheet-related helper and its internal tests were removed from Enterprise because the logic now lives in the shared spreadsheet library. This reduces duplicate maintenance and helps keep spreadsheet behavior consistent across products.
Original PR description
This commit delete the helper `mergeContiguousZones` and its tests from enterprise, as they were moved to the o-spreadsheet library. Task: [3965270](https://www.odoo.com/web#id=3965270&cids=1&menu_id=4720&action=333&active_id=2328&model=project.task&view_type=form)
Original PR description
We refactor the way unavailabilities are fetched in the gantt view. The main thing we want is to fetch unavailabilities along the main gantt data (groups and records). Indeed, we think it is bad to…
We refactor the way unavailabilities are fetched in the gantt view. The main thing we want is to fetch unavailabilities along the main gantt data (groups and records). Indeed, we think it is bad to have to fetch groups, create rows, send rows to the server, enrich those rows server side, send the enriched rows back. Moreover the API of gantt_unavailability was bad and forced most overrides to traverse the rows, convert the start_date, stop_date,...
So here we have make gantt_unavailability private, rationalize its API to make it a bit closer to the API of gantt_progress_bar, and call it directly in get_gantt_data.
Since the old API did allow to enrich a single row (e.g. in the case grouby=[]) or a row with a corresponding res_id = False, we still allow here to send unavailabilities for those cases in the following way:
```py
unavailabilities = {
'__default': { False: global_default_unavailabilities, ... },
<field_name>: { False: default_unavailabilities, ... },
...
}
```