Search code examples
odooodoo-9odoo-view

How can I create a report view from multiple models in odoo 9 SA?


I'm using Odoo 9 SA and I want to make a report view (either a tabular list view, or a pivot table) that pulls data out of the sales model, the inventory model and the partner model. How can I accomplish this? From reading, it seems that I should make a new model that has reference fields to the other models and then build a new view from that model.. I'm just not sure if this is the best way and then if so, how to approach it.

Any advice?


Solution

  • For complex reports and pivot views you can create a Model that uses an SQL view to get the data. You can then provide list or pivot view for it, or even QWeb reports.

    Here is an example of this, in the core Project module: https://github.com/odoo/odoo/blob/9.0/addons/project/report/project_report.py