Thursday, March 9, 2023
1 change · master
Code cleanup and technical improvements
This update rebuilds Odoo's grid views with a newer interface foundation, reducing data sent from the server and making grids easier to maintain. Timesheets, forecasting, sales timesheets, analytics, and consolidation grids are updated, improving performance and preparing these views for future enhancements.
Original PR description
Purpose ======= The main goal is to convert the grid view in OWL to be able to remove the legacy code. Also, the API has been reviewed to be able to use sample server as it is the case in the other…
Purpose ======= The main goal is to convert the grid view in OWL to be able to remove the legacy code. Also, the API has been reviewed to be able to use sample server as it is the case in the other views. Implementation Details ---------------------- ### web_grid The grid view structure is now built in the JS as the others views based on the data fetched. Those data are now fetched via read_group method as the others views to be able to use the sample server without reimplementing the python methods implemented only for the grid in JS. It means the `read_grid` and `read_grid_grouped` are no longer used and removed. The group expand was not correctly supported in the grid view, only the section field triggered the group_expand of the field used for section and if the group expand is needed for the fields used in rows then the inner method called by `read_grip` and `read_grid_grouped` is override. Currently, the group expand will be prepared in JS to call an extra read_group to get those data. The advantage by doing that is the data passed has been drastically reduced since the structure of the grid view (header, rows, cells) are no longer computed in server side. #### Others changes made - `adjust_grid` method has been replaced by `grid_update_cell` - `grid_unavailability` method has been added to be able to return the unavailability dates of the current user or the employees in the grid section (in the case of timesheets). ### timesheet_grid*, project_timesheet_forecast, sale_timesheet_enterprise - convert timer header component has been reviewed to be able to convert the timer timesheet grid view in OWL. - convert timesheet grid in OWL. - convert timer timesheet grid in OWL with timer header component for My Timesheets grid view. ### analytic_enterprise An override was made to change the period start and end according to fiscal year dates defined in the current company when the range scale is `Year`. This override is now made in custom new method called `grid_compute_year_range` and this method is called before the column are generated if the range scale is in `Year`. ### account_consolidation The custom grid view has been converted in OWL. An override was made to make cell in readonly if the journal is auto_generated. This behavior is now done when the many2one columns are fetched to get the readonly columns. task-2702636 Co-authored-by: Xavier Bol (xbo) <xbo@odoo.com> Co-authored-by: Audric Onockx (auon) <auon@odoo.com> Co-authored-by: Elisabeth Dickinson <edi@odoo.com>