Daily updates from Odoo
Tuesday, May 16, 2023
1 change · master
Code cleanup and technical improvements
Financial reports have been rebuilt on Odoo's newer interface framework, making them easier to maintain and customize. This also separates on-screen report layouts from PDF printing layouts, helping future changes to each format be handled more reliably.
Original PR description
### [REF] account_reports: conversion to owl This commit converts account_reports to owl. Here is a list of the main components: * **AccountReportController** is the main component. It is in charge…
### [REF] account_reports: conversion to owl This commit converts account_reports to owl. Here is a list of the main components: * **AccountReportController** is the main component. It is in charge of all the heavy lifting like getting the data from the database (with get_report_information), keeping the data well formatted with getters/setters functions, offering a bunch of helpers functions and managing functions useful for other components (line visibility, footnotes, etc). * **AccountReport** represent an account report (duh). Its main function is to construct the report. It is the one that calls AccountReportController to get the data and make it available on other components. It is also in charge of the overriding of components and templates that allows reports to be fully customizable. To override a component you can use the `_get_custom_display_config` hook function defined in `account_reports.py`. * **AccountReportFilters** is in charge of managing all the filters available on an account report. * **AccountReportHeader** is the table header of a report. It can manage all column interactions such as sorting. * **AccountReportLine** represents a table row of a report (expect the ones on the table header). It also manage the debug popover. * **AccountReportLineName** represents the cell on the far left of a table row. It manages the load more, the caret options and the foldable of a line. * **AccountReportLineCell** represents all other cells of a table row. It is in charge of the auditable functionality and the edition of manual values. As said, those are only the main components. There is a few more used for more specific stuff. This commit also separates the templates used for the display of account reports in the web client and the templates used for pdf printing. The pdf templates can be overriden the same way as the components by using the `_get_custom_display_config` hook function on `account_reports.py`.