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:

Creating business reports

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.xml model, which is a particular type of client action. Its data is available in the Settings | Technical | Reports menu option.

After installing this, the to-do task form view will display a Print button at the top, to the left of the More button, containing this option to run the report.

It won't work right now, since we haven't defined the report yet. This will be a QWeb report, so it will use a QWeb template. The name attribute identifies the template to be used. Unlike other identifier references, the module prefix in the name attribute is required. We must use the full reference <module_name>.<identifier_name>.