Usually we would implement the report in our To Do app addon module. But for learning purposes, we will create a new addon module just for our report.
Our report will look like this:
We will name this new addon module todo_report
. The first thing to do is to create an empty __init__.py
file and the __manifest__.py
manifest file:
{ 'name': 'To-Do Report', 'description': 'Report for To-Do tasks.', 'author': 'Daniel Reis', 'depends': ['todo_kanban'], 'data': ['reports/todo_report.xml'] }
The reports/todo_report.xml
file can start by declaring the new report as follows:
<?xml version="1.0"?> <odoo> <report id="action_todo_task_report" string="To-do Tasks" model="todo.task" report_type="qweb-pdf" name="todo_report.report_todo_task_template" /> </odoo>
The <report>
tag is a shortcut to write data to the ir.actions.report...