SlideShare a Scribd company logo
Business Intelligence
Develop cube views for your own objects
Content
1. BI/Graph View
2. Technical Overview
3. Preparing Data
4. Displaying cube views
5. Case study: cross models
6. Conclusion
BI/Graph View
BI/Graph View
measure : can be aggregated (right now, only summed)
dimension : can be grouped
·
·
A Short History of BI in Odoo
pre 2014: list view + group bys, graph view
Q1/Q2 2014: graph view rewrite -> pivot table + graphs,
lots of backend work
future: ? we're looking at searchview/BI view integration.
·
·
·
Technical Overview
Odoo architecture
Anatomy of BI/Graph View
pivot tablepivot table: keeps the data, calls the ORM
graph widgetgraph widget : user interaction
graph viewgraph view : client interaction
·
·
·
BI view xml
<record<record id="..." model="ir.ui.view">>
<field<field name="name">>crm.opportunity.report.graph</field></field>
<field<field name="model">>crm.lead.report</field></field>
<field<field name="arch" type="xml">>
<graph<graph string="Leads Analysis" type="pivot" stacked="True">>
<field<field name="date_deadline" type="row"/>/>
<field<field name="stage_id" type="col"/>/>
<field<field name="planned_revenue" type="measure"/>/>
</graph></graph>
</field></field>
</record></record>
BI view API
In graph tag:
string: title
stacked: if bar chart is stacked/not stacked (default=false)
type: mode (pivot, bar, pie, line) (default=bar)
In field tags, type attribute:
row : will be grouped by rows (dimension)
col : will be grouped by cols (dimension)
measure : will be aggregated
if no type, measure by default
·
·
·
·
·
·
·
Date/datetime
Always want to be different: date/datetime have a special
syntax for groupby:
field_date:day,
field_date:week,
field_date:month (default)
field_date:quarter,
field_date:year
<graph<graph string="Leads Analysis" type="pivot" stacked="True">>
<field<field name="date_deadline:week" type="row"/>/>
<field<field name="stage_id" type="col"/>/>
<field<field name="planned_revenue" type="measure"/>/>
</graph></graph>
·
·
·
·
·
Graph widget setup
Graph widget has two more options:
visible_ui (true) : indicate if UI is visible
heatmap_mode ('none') can be set to row/col/both
·
·
Preparing Data
Odoo Model
Odoo BI view will read the various fields. Depending on
their type, it will use them for
measures : every fields of type integer, float (except 'id')
dimensions :
right now: every fields defined in the 'group by'
category in the search bar.
later: every field that can be grouped by the db
·
·
·
·
Where is your data?
The data needs to satisfy two conditions:
be stored in the database (beware of functional fields not
stored)
be accessed from one single odoo model
If yes, you're done. If not, two possibilities:
can you extend a model? (stored functional fields,
relational fields)
can you create a custom model with a postgres view, to
link the various models with the data?
Bottom line: it needs to be in the DB
·
·
·
·
Extending a model
WARNING: old API... Do not try this at home!!!
classclass res_partner((osv..osv):):
_name == 'res.partner'
_inherit == 'res.partner'
defdef _total_invoice((self,, cr,, uid,, ids,, ......):):
......
# [insert here nice looking code to
# compute the total invoice of a customer]
......
returnreturn result
_columns == {{
'total_invoiced':: fields..function((_total_invoice,,
string=="Total Invoiced",, type=='float',, store==True))
}}
More advanced: Cross model
analysis
Example: purchase/report/purchase_report.py
All reporting views use that technique. Warning: bypass the
ORM
Displaying cube views
Edit in live
1. go to developer mode
2. edit action, add 'graph',
3. edit views, create 'graph'
4. profit!
Good for testing.
Adding a BI view with xml
Add the desired graph view:
<record<record id="view_project_task_graph" model="ir.ui.view">>
<field<field name="name">>project.task.graph</field></field>
<field<field name="model">>project.task</field></field>
<field<field name="arch" type="xml">>
<graph<graph string="Project Tasks" type="bar">>
<field<field name="project_id" type="row"/>/>
<field<field name="planned_hours" type="measure"/>/>
</graph></graph>
</field></field>
</record></record>
Adding a BI view with xml(2)
Add it to the action:
<record<record id="action_view_task" model="ir.actions.act_window">>
...
<field<field name="view_mode">>kanban,tree,form,calendar,gantt,graph</field></field>
...
You can force the correct view:
<field<field name="view_id" ref="view_project_task_graph"/>/>
Advanced: client action
In js, create a widget and append it to your view:
thisthis..graph_widget == newnew openerp..web_graph..Graph((
thisthis,,
some_model,,
some_domain,,
options););
thisthis..graph_widget..appendTo((thisthis..$el););
Future of BI in odoo?
Thank you

More Related Content

PDF
Odoo icon smart buttons
PDF
Odoo - Smart buttons
PDF
Improving the performance of Odoo deployments
PPTX
Deploying & Scaling your Odoo Server
PDF
Tools for Solving Performance Issues
PDF
Impact of the New ORM on Your Modules
PDF
Asynchronous JS in Odoo
PPTX
Best Practices in Handling Performance Issues
Odoo icon smart buttons
Odoo - Smart buttons
Improving the performance of Odoo deployments
Deploying & Scaling your Odoo Server
Tools for Solving Performance Issues
Impact of the New ORM on Your Modules
Asynchronous JS in Odoo
Best Practices in Handling Performance Issues

What's hot (20)

PPTX
Empower your App by Inheriting from Odoo Mixins
PPTX
Odoo's Test Framework - Learn Best Practices
PDF
Odoo Performance Limits
PPTX
Developing New Widgets for your Views in Owl
PDF
Tips on how to improve the performance of your custom modules for high volume...
PDF
The Odoo JS Framework
PPTX
Mongo DB 성능최적화 전략
PPTX
Owl: The New Odoo UI Framework
PDF
Odoo - From v7 to v8: the new api
PPTX
What is Computed Fields and @api Depends in Odoo 15
PDF
날로 먹는 Django admin 활용
PDF
간단한 블로그를 만들며 Django 이해하기
PPTX
An in Depth Journey into Odoo's ORM
PPTX
Widgets in odoo
PPTX
Angular
PDF
New Framework - ORM
PDF
Empower your App by Inheriting from Odoo Mixins
PDF
A Basic Django Introduction
PPTX
Odoo (Build module, Security, ORM)
PPTX
odoo 11.0 development (CRUD)
Empower your App by Inheriting from Odoo Mixins
Odoo's Test Framework - Learn Best Practices
Odoo Performance Limits
Developing New Widgets for your Views in Owl
Tips on how to improve the performance of your custom modules for high volume...
The Odoo JS Framework
Mongo DB 성능최적화 전략
Owl: The New Odoo UI Framework
Odoo - From v7 to v8: the new api
What is Computed Fields and @api Depends in Odoo 15
날로 먹는 Django admin 활용
간단한 블로그를 만들며 Django 이해하기
An in Depth Journey into Odoo's ORM
Widgets in odoo
Angular
New Framework - ORM
Empower your App by Inheriting from Odoo Mixins
A Basic Django Introduction
Odoo (Build module, Security, ORM)
odoo 11.0 development (CRUD)
Ad

Similar to Odoo - Business intelligence: Develop cube views for your own objects (20)

PDF
Develop an App with the Odoo Framework
ODP
Drupal Views development
PPTX
Develop an App with the Odoo Framework.pptx
PDF
A Comprehensive Guide to Building Custom Odoo Dashboards
PDF
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
PDF
Simplify Feature Engineering in Your Data Warehouse
PDF
Drupal tips 'n tricks
DOCX
Social Networking using ROR
PDF
Data herding
PDF
Data herding
PDF
BRAINOMICS A management system for exploring and merging heterogeneous brain ...
PDF
Brainomics - CrEDIBLE 2013
PPTX
Webinar: Scaling MongoDB
PPT
PPT
Vanjs backbone-powerpoint
PDF
Making views - DrupalGov Canberra 2017
PPTX
Planbox Backbone MVC
PPT
MVC Demystified: Essence of Ruby on Rails
PPTX
Data Modeling Comparison: Tableau, Cognos and Power BI
PDF
Mvc4 crud operations.-kemuning senja
Develop an App with the Odoo Framework
Drupal Views development
Develop an App with the Odoo Framework.pptx
A Comprehensive Guide to Building Custom Odoo Dashboards
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
Simplify Feature Engineering in Your Data Warehouse
Drupal tips 'n tricks
Social Networking using ROR
Data herding
Data herding
BRAINOMICS A management system for exploring and merging heterogeneous brain ...
Brainomics - CrEDIBLE 2013
Webinar: Scaling MongoDB
Vanjs backbone-powerpoint
Making views - DrupalGov Canberra 2017
Planbox Backbone MVC
MVC Demystified: Essence of Ruby on Rails
Data Modeling Comparison: Tableau, Cognos and Power BI
Mvc4 crud operations.-kemuning senja
Ad

More from Odoo (20)

PPTX
Timesheet Workshop: The Timesheet App People Love!
PPTX
Odoo 3D Product View with Google Model-Viewer
PPTX
Keynote - Vision & Strategy
PPTX
Opening Keynote - Unveilling Odoo 14
PDF
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
PDF
Managing Multi-channel Selling with Odoo
PPTX
Product Configurator: Advanced Use Case
PDF
Accounting Automation: How Much Money We Saved and How?
PPTX
Rock Your Logistics with Advanced Operations
PPTX
Transition from a cost to a flow-centric organization
PDF
Synchronization: The Supply Chain Response to Overcome the Crisis
PPTX
Running a University with Odoo
PPTX
Down Payments on Purchase Orders in Odoo
PPTX
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
PPTX
Migration from Salesforce to Odoo
PPTX
Preventing User Mistakes by Using Machine Learning
PPTX
Becoming an Odoo Expert: How to Prepare for the Certification
PPTX
Instant Printing of any Odoo Report or Shipping Label
PPTX
How Odoo helped an Organization Grow 3 Fold
PPTX
From Shopify to Odoo
Timesheet Workshop: The Timesheet App People Love!
Odoo 3D Product View with Google Model-Viewer
Keynote - Vision & Strategy
Opening Keynote - Unveilling Odoo 14
Extending Odoo with a Comprehensive Budgeting and Forecasting Capability
Managing Multi-channel Selling with Odoo
Product Configurator: Advanced Use Case
Accounting Automation: How Much Money We Saved and How?
Rock Your Logistics with Advanced Operations
Transition from a cost to a flow-centric organization
Synchronization: The Supply Chain Response to Overcome the Crisis
Running a University with Odoo
Down Payments on Purchase Orders in Odoo
Odoo Implementation in Phases - Success Story of a Retail Chain 3Sach food
Migration from Salesforce to Odoo
Preventing User Mistakes by Using Machine Learning
Becoming an Odoo Expert: How to Prepare for the Certification
Instant Printing of any Odoo Report or Shipping Label
How Odoo helped an Organization Grow 3 Fold
From Shopify to Odoo

Recently uploaded (20)

PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
PDF
Modernizing your data center with Dell and AMD
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
PDF
Top Generative AI Tools for Patent Drafting in 2025.pdf
PPTX
CroxyProxy Instagram Access id login.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PPTX
How to Build Crypto Derivative Exchanges from Scratch.pptx
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Dell Pro 14 Plus: Be better prepared for what’s coming
PDF
REPORT: Heating appliances market in Poland 2024
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
PDF
Google’s NotebookLM Unveils Video Overviews
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
Modernizing your data center with Dell and AMD
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
Top Generative AI Tools for Patent Drafting in 2025.pdf
CroxyProxy Instagram Access id login.pptx
Understanding_Digital_Forensics_Presentation.pptx
Reimagining Insurance: Connected Data for Confident Decisions.pdf
Belt and Road Supply Chain Finance Blockchain Solution
How to Build Crypto Derivative Exchanges from Scratch.pptx
GamePlan Trading System Review: Professional Trader's Honest Take
Chapter 2 Digital Image Fundamentals.pdf
Dell Pro 14 Plus: Be better prepared for what’s coming
REPORT: Heating appliances market in Poland 2024
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Google’s NotebookLM Unveils Video Overviews
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

Odoo - Business intelligence: Develop cube views for your own objects

  • 1. Business Intelligence Develop cube views for your own objects
  • 2. Content 1. BI/Graph View 2. Technical Overview 3. Preparing Data 4. Displaying cube views 5. Case study: cross models 6. Conclusion
  • 4. BI/Graph View measure : can be aggregated (right now, only summed) dimension : can be grouped · ·
  • 5. A Short History of BI in Odoo pre 2014: list view + group bys, graph view Q1/Q2 2014: graph view rewrite -> pivot table + graphs, lots of backend work future: ? we're looking at searchview/BI view integration. · · ·
  • 8. Anatomy of BI/Graph View pivot tablepivot table: keeps the data, calls the ORM graph widgetgraph widget : user interaction graph viewgraph view : client interaction · · ·
  • 9. BI view xml <record<record id="..." model="ir.ui.view">> <field<field name="name">>crm.opportunity.report.graph</field></field> <field<field name="model">>crm.lead.report</field></field> <field<field name="arch" type="xml">> <graph<graph string="Leads Analysis" type="pivot" stacked="True">> <field<field name="date_deadline" type="row"/>/> <field<field name="stage_id" type="col"/>/> <field<field name="planned_revenue" type="measure"/>/> </graph></graph> </field></field> </record></record>
  • 10. BI view API In graph tag: string: title stacked: if bar chart is stacked/not stacked (default=false) type: mode (pivot, bar, pie, line) (default=bar) In field tags, type attribute: row : will be grouped by rows (dimension) col : will be grouped by cols (dimension) measure : will be aggregated if no type, measure by default · · · · · · ·
  • 11. Date/datetime Always want to be different: date/datetime have a special syntax for groupby: field_date:day, field_date:week, field_date:month (default) field_date:quarter, field_date:year <graph<graph string="Leads Analysis" type="pivot" stacked="True">> <field<field name="date_deadline:week" type="row"/>/> <field<field name="stage_id" type="col"/>/> <field<field name="planned_revenue" type="measure"/>/> </graph></graph> · · · · ·
  • 12. Graph widget setup Graph widget has two more options: visible_ui (true) : indicate if UI is visible heatmap_mode ('none') can be set to row/col/both · ·
  • 14. Odoo Model Odoo BI view will read the various fields. Depending on their type, it will use them for measures : every fields of type integer, float (except 'id') dimensions : right now: every fields defined in the 'group by' category in the search bar. later: every field that can be grouped by the db · · · ·
  • 15. Where is your data? The data needs to satisfy two conditions: be stored in the database (beware of functional fields not stored) be accessed from one single odoo model If yes, you're done. If not, two possibilities: can you extend a model? (stored functional fields, relational fields) can you create a custom model with a postgres view, to link the various models with the data? Bottom line: it needs to be in the DB · · · ·
  • 16. Extending a model WARNING: old API... Do not try this at home!!! classclass res_partner((osv..osv):): _name == 'res.partner' _inherit == 'res.partner' defdef _total_invoice((self,, cr,, uid,, ids,, ......):): ...... # [insert here nice looking code to # compute the total invoice of a customer] ...... returnreturn result _columns == {{ 'total_invoiced':: fields..function((_total_invoice,, string=="Total Invoiced",, type=='float',, store==True)) }}
  • 17. More advanced: Cross model analysis Example: purchase/report/purchase_report.py All reporting views use that technique. Warning: bypass the ORM
  • 19. Edit in live 1. go to developer mode 2. edit action, add 'graph', 3. edit views, create 'graph' 4. profit! Good for testing.
  • 20. Adding a BI view with xml Add the desired graph view: <record<record id="view_project_task_graph" model="ir.ui.view">> <field<field name="name">>project.task.graph</field></field> <field<field name="model">>project.task</field></field> <field<field name="arch" type="xml">> <graph<graph string="Project Tasks" type="bar">> <field<field name="project_id" type="row"/>/> <field<field name="planned_hours" type="measure"/>/> </graph></graph> </field></field> </record></record>
  • 21. Adding a BI view with xml(2) Add it to the action: <record<record id="action_view_task" model="ir.actions.act_window">> ... <field<field name="view_mode">>kanban,tree,form,calendar,gantt,graph</field></field> ... You can force the correct view: <field<field name="view_id" ref="view_project_task_graph"/>/>
  • 22. Advanced: client action In js, create a widget and append it to your view: thisthis..graph_widget == newnew openerp..web_graph..Graph(( thisthis,, some_model,, some_domain,, options);); thisthis..graph_widget..appendTo((thisthis..$el););
  • 23. Future of BI in odoo?