How to Inherit Existing Pivot View Report in Odoo 17

HISHAM
May 30, 2024
pivot-vew report-in-odoo-17

Pivot view reports in Odoo summarize and present business data in a pivot table format, offering insightful analysis. businesses occasionally need to alter these reports, though, in order to meet their unique needs. It is possible for users to increase the functionality of standard reports without having to start from scratch by inheriting existing pivot view reports.

Understanding Pivot View Reports:

Let’s quickly review pivot view reports before getting into inheritance. You can analyze large datasets in Odoo by arranging them into rows and columns and using to view reports, which enable you to group, filter, and aggregate data. These reports offer a dynamic means of displaying data and obtaining useful insights.

Steps to Inherit Existing Pivot View Reports in Odoo 17

1. Inheriting Model: Take a look at a purchase report to see how view inheritance works. Below is a screenshot of a purchase analysis report.

inherit existing pivot view reports

Here is the Python code on how to inherit a purchase report in Odoo 17:

2. Inheriting View: The screenshot shows the dates arranged in rows and the sales team grouped in columns,
been provided. Let’s now flip these fields to show sales teams in rows and dates in columns.
in columns. We will inherit the Sales report view order to do this.

We inherit the current pivot report by using the external ID ‘purchase. purchase_order_pivot’ in the
given code snippet. In this instance, we swap out and set up the fields, making the team_id field
appear as rows and the date field as columns.

3. To Add More Fields as Rows or Columns:

Let’s look at an example of adding more fields as rows or columns:

We have included the “company” field as a column in the code snippet that has been provided.
Running the mentioned code will display an unexpanded subfield at a lower place in the date field.

To substitute the default field in the pivot view, you can employ the following command:

In Odoo 17, inheriting pre-existing pivot reports offers a strong way to extend and modify standard reports to satisfy particular business requirements. Users can improve the functionality of pivot reports and obtain deeper insights into their data by utilizing the flexibility of Odoo’s framework, as detailed in this blog post.

"Unlock the Full Potential of Your Business with Odoo ERP!"

"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"

Get a Free Quote

Leave a Reply

Your email address will not be published. Required fields are marked *