In Reportalypse, custom reports use fields to refer to functions
allowing customizing different behaviors of the engine.
With this, all account.report models contain all the functions
of all the custom reports, leading to possible name clashes
if the functions aren't properly prefixed.
We can improve that a little: instead of having multiple fields,
we use but one, referring to an AbstractModel inheriting
from a new AbstractModel called account.report.custom.handler.
This AbstractModel simply contains the different functions
that can be overridden, and its subclasses are responsible to do so.
In the code, instead of calling _get_custom_report_function,
we check whether there is a custom handler for the report,
and call the right function on it.
task-2954761
closesodoo/odoo#98973
Related: odoo/documentation#2673
Related: odoo/enterprise#30777
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
This commit adapts account's model to the new report engine introduced for v16, and updates the data files accordingly.
account.report model is now declared in community, together with the other models used by the reporting. This is done so that the tax tags can properly be created by the tax report and used on tax templates. All the actual computation logic stays in enterprise.
See enterprise commit for full details.
Task 2524389
Part-of: odoo/odoo#94125