How to use read_group
method in Odoo 17
Enterprise
Introduction
Enterprise
In this slide, we will explore the use of the read_group method in
Odoo, which is commonly used for retrieving grouped data
efficiently. This method is particularly helpful when performing
aggregation or summarizing records based on specific fields, such
as grouping by category or date.
Enterprise
This is our custom model where we define the fields in the
model.
Enterprise
We have 8 records created in this model.
Enterprise
Using the read_group method, we can group data based on the
domain we provide, we can choose the fields for it and also
groupby based on a field. In the domain, we can provide tuple to
filter records, In the fields and groupby parameter we can
provide the list of fields to group the data based on it. We have
given the read_group method inside a button function.
Enterprise
If we click on this button, the function triggers and read_group
method will return the result as a list of dictionaries.
Enterprise
In the log, we can see the result of the read_group method.
For More Info.
Check our company website for related blogs
and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
Enterprise
www.cybrosys.com

How to use read_group method in Odoo 17 - Odoo Slides

  • 1.
    How to useread_group method in Odoo 17 Enterprise
  • 2.
    Introduction Enterprise In this slide,we will explore the use of the read_group method in Odoo, which is commonly used for retrieving grouped data efficiently. This method is particularly helpful when performing aggregation or summarizing records based on specific fields, such as grouping by category or date.
  • 3.
    Enterprise This is ourcustom model where we define the fields in the model.
  • 4.
    Enterprise We have 8records created in this model.
  • 5.
    Enterprise Using the read_groupmethod, we can group data based on the domain we provide, we can choose the fields for it and also groupby based on a field. In the domain, we can provide tuple to filter records, In the fields and groupby parameter we can provide the list of fields to group the data based on it. We have given the read_group method inside a button function.
  • 6.
    Enterprise If we clickon this button, the function triggers and read_group method will return the result as a list of dictionaries.
  • 7.
    Enterprise In the log,we can see the result of the read_group method.
  • 8.
    For More Info. Checkour company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com