際際滷

際際滷Share a Scribd company logo
How to Create Cohort
View in Odoo 17
Enterprise
Introduction
Enterprise
Odoo has a variety of view kinds, including list, form, tree,
kanban, graph, pivot, calendar, cohort, and more. Cohort views
are a kind of reporting view in Odoo that let us monitor and
evaluate user behavior across time. Rows and columns are
displayed in the cohort view. We may simply obtain data on a
day-by-day, weekly, monthly, and annual basis by looking for the
intersection of a row and column, which displays a specific metric
or value for that cohort in that particular period.
Enterprise
To create a cohort view in Odoo, we need to define a model with the
required fields
Enterprise
 create a new model and add a menu action under the
configuration tab. Below is python code for creating a new
class in Odoo.
class EmployeeDetails(models.Model):
_name = 'employee.details'
_description = 'Employee Details'
_rec_name = "employee_id"
employee_id = fields.Many2one('hr.employee', string="Employee")
phone = fields.Char(related="employee_id.work_phone")
email = fields.Char(related="employee_id.work_email")
date = fields.Date(string="Date", required=True)
Enterprise
 We can choose employees from hr.employee in the newly
created class EmployeeDetails.
 Since the phone and email fields are configured as linked
fields, they will immediately fill in when we choose
employees.
 Added a date field and made it mandatory since the date in
cohort view was set to date_stop.
Enterprise
 Then, we need to give security for the above model. For
that, create a new directory with a new csv file. Specify an
id, name, and model id here. And give this security file in
the manifest file.
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access.emp_details,access_emp_details,model_employee_details,base.group_user,1,1,1,1
Enterprise
 Before creating a cohort view add web_cohort as a
dependent module in the manifest file.
 Next, we can create an xml file to create a view.
 First, we want to create ir.actions.act.window model with
model name employee.details, and here we need to specify
the view mode which type required, below mentioned the
view as tree, form, and cohort. And set an id
employee_details_action_menu to provide menu action for
our model and give this id as action in the menu item.
Enterprise
<record id="employee_details_action_menu" model="ir.actions.act_window">
<field name="name">Employee Details</field>
<field name="res_model">employee.details</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,form,cohort</field>
</record>
Enterprise
 For creating a cohort view, first need to give an id for the
record and specify the model as ir.ui.view. And give a field
name and add the model as employee.details.
 After that, mention the desired string for cohort tag, set
date_start as create date, then take the date_stop from the
newly created module, and we can provide the interval as
day, week, month and year, and here the mode is set as
churn.
Enterprise
<record id="employee_details_view_cohort" model="ir.ui.view">
<field name="name">employee.details.view.cohort</field>
<field name="model">employee.details</field>
<field name="arch" type="xml">
<cohort string="Analysis" date_start="create_date" date_stop="date"
interval="day" mode="churn"/>
</field>
</record>
Enterprise
 Then set the menu action for the model. In the menu item
tag, set action as the record id which is mentioned above,
and set the parent where we want to show the menu item.
<menuitem id="employee_details_menu_root"
name="Employee Details"
action="employee_details_action_menu"
parent="hr.menu_config_employee"
sequence="20"/>
Enterprise
We can see the Employee Details menu just click on that can see
the details
Enterprise
Click on the menu, it will open a new model in the tree view
format, where we can create new records.
Enterprise
Click on the cohort view icon and we can see the report of the records
day wise in the UI.
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

More Related Content

Similar to How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s (20)

How to Add Sort Option in Website Portal Odoo 17
How to Add Sort Option in Website Portal Odoo 17How to Add Sort Option in Website Portal Odoo 17
How to Add Sort Option in Website Portal Odoo 17
Celine George
Aggregate feature in list view odoo 17.pptx
Aggregate feature in list view odoo 17.pptxAggregate feature in list view odoo 17.pptx
Aggregate feature in list view odoo 17.pptx
Celine George
Report Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷sReport Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷s
Celine George
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Celine George
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
Celine George
Odoo (OpenERP) - Creating a module
Odoo (OpenERP) - Creating a moduleOdoo (OpenERP) - Creating a module
Odoo (OpenERP) - Creating a module
Tarun Behal
View Inheritance in Odoo 17 - Odoo 17 際際滷s
View Inheritance in Odoo 17 - Odoo 17  際際滷sView Inheritance in Odoo 17 - Odoo 17  際際滷s
View Inheritance in Odoo 17 - Odoo 17 際際滷s
Celine George
Odoo (open erp) creating a module
Odoo (open erp) creating a moduleOdoo (open erp) creating a module
Odoo (open erp) creating a module
Tarun Behal
Customization of Odoo 17 Periodic Digest parameters from backend
Customization of Odoo 17 Periodic Digest parameters from backendCustomization of Odoo 17 Periodic Digest parameters from backend
Customization of Odoo 17 Periodic Digest parameters from backend
Celine George
HOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOOHOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOO
Celine George
Tips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptxTips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptx
Agusto Sipahutar
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17
Celine George
How to make a component and add it to systray in Odoo
How to make a component and add it to systray in OdooHow to make a component and add it to systray in Odoo
How to make a component and add it to systray in Odoo
Celine George
URLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷sURLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷s
Celine George
How to Install Custom Module in Odoo 17 - Odoo 17 際際滷s
How to Install Custom Module in Odoo 17 - Odoo 17 際際滷sHow to Install Custom Module in Odoo 17 - Odoo 17 際際滷s
How to Install Custom Module in Odoo 17 - Odoo 17 際際滷s
Celine George
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Celine George
How to Create a Dynamic Snippet in Odoo 17
How to Create a Dynamic Snippet in Odoo 17How to Create a Dynamic Snippet in Odoo 17
How to Create a Dynamic Snippet in Odoo 17
Celine George
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
Celine George
Subscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-finalSubscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-final
Samuel Sharaf
How to Create a Dynamic Report in Odoo 17
How to Create a Dynamic Report in Odoo 17How to Create a Dynamic Report in Odoo 17
How to Create a Dynamic Report in Odoo 17
Celine George
How to Add Sort Option in Website Portal Odoo 17
How to Add Sort Option in Website Portal Odoo 17How to Add Sort Option in Website Portal Odoo 17
How to Add Sort Option in Website Portal Odoo 17
Celine George
Aggregate feature in list view odoo 17.pptx
Aggregate feature in list view odoo 17.pptxAggregate feature in list view odoo 17.pptx
Aggregate feature in list view odoo 17.pptx
Celine George
Report Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷sReport Actions In Odoo 17 - Odoo 17 際際滷s
Report Actions In Odoo 17 - Odoo 17 際際滷s
Celine George
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
Celine George
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
Celine George
Odoo (OpenERP) - Creating a module
Odoo (OpenERP) - Creating a moduleOdoo (OpenERP) - Creating a module
Odoo (OpenERP) - Creating a module
Tarun Behal
View Inheritance in Odoo 17 - Odoo 17 際際滷s
View Inheritance in Odoo 17 - Odoo 17  際際滷sView Inheritance in Odoo 17 - Odoo 17  際際滷s
View Inheritance in Odoo 17 - Odoo 17 際際滷s
Celine George
Odoo (open erp) creating a module
Odoo (open erp) creating a moduleOdoo (open erp) creating a module
Odoo (open erp) creating a module
Tarun Behal
Customization of Odoo 17 Periodic Digest parameters from backend
Customization of Odoo 17 Periodic Digest parameters from backendCustomization of Odoo 17 Periodic Digest parameters from backend
Customization of Odoo 17 Periodic Digest parameters from backend
Celine George
HOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOOHOW TO CREATE A MODULE IN ODOO
HOW TO CREATE A MODULE IN ODOO
Celine George
Tips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptxTips On Trick Odoo Add-On.pptx
Tips On Trick Odoo Add-On.pptx
Agusto Sipahutar
How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17How to Create & Manage a Dashboard Using OWL in Odoo 17
How to Create & Manage a Dashboard Using OWL in Odoo 17
Celine George
How to make a component and add it to systray in Odoo
How to make a component and add it to systray in OdooHow to make a component and add it to systray in Odoo
How to make a component and add it to systray in Odoo
Celine George
URLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷sURLS and routing in odoo 18 - Odoo 際際滷s
URLS and routing in odoo 18 - Odoo 際際滷s
Celine George
How to Install Custom Module in Odoo 17 - Odoo 17 際際滷s
How to Install Custom Module in Odoo 17 - Odoo 17 際際滷sHow to Install Custom Module in Odoo 17 - Odoo 17 際際滷s
How to Install Custom Module in Odoo 17 - Odoo 17 際際滷s
Celine George
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
Celine George
How to Create a Dynamic Snippet in Odoo 17
How to Create a Dynamic Snippet in Odoo 17How to Create a Dynamic Snippet in Odoo 17
How to Create a Dynamic Snippet in Odoo 17
Celine George
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
Celine George
Subscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-finalSubscribed zuora forsalesforce training -section301-final
Subscribed zuora forsalesforce training -section301-final
Samuel Sharaf
How to Create a Dynamic Report in Odoo 17
How to Create a Dynamic Report in Odoo 17How to Create a Dynamic Report in Odoo 17
How to Create a Dynamic Report in Odoo 17
Celine George

More from Celine George (20)

How to Manage Work Order Dependencies in Odoo 17 Manufacturing
How to Manage Work Order Dependencies in Odoo 17 ManufacturingHow to Manage Work Order Dependencies in Odoo 17 Manufacturing
How to Manage Work Order Dependencies in Odoo 17 Manufacturing
Celine George
How to setup Cash Basis Tax computation in odoo Accounting
How to setup Cash Basis Tax computation in odoo AccountingHow to setup Cash Basis Tax computation in odoo Accounting
How to setup Cash Basis Tax computation in odoo Accounting
Celine George
How to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 AccountingHow to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 Accounting
Celine George
How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17
Celine George
How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17
Celine George
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷sField Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Celine George
How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17
Celine George
How to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of SaleHow to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of Sale
Celine George
How to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in OdooHow to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in Odoo
Celine George
How to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of SaleHow to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of Sale
Celine George
Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18
Celine George
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷sPurchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Celine George
Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17
Celine George
How to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 WebsiteHow to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 Website
Celine George
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
How to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting AppHow to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting App
Celine George
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18
Celine George
How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18
Celine George
How to Manage Work Order Dependencies in Odoo 17 Manufacturing
How to Manage Work Order Dependencies in Odoo 17 ManufacturingHow to Manage Work Order Dependencies in Odoo 17 Manufacturing
How to Manage Work Order Dependencies in Odoo 17 Manufacturing
Celine George
How to setup Cash Basis Tax computation in odoo Accounting
How to setup Cash Basis Tax computation in odoo AccountingHow to setup Cash Basis Tax computation in odoo Accounting
How to setup Cash Basis Tax computation in odoo Accounting
Celine George
How to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 AccountingHow to setup journals in Odoo 17 Accounting
How to setup journals in Odoo 17 Accounting
Celine George
How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17How to handle the storage categories of the locations in Odoo 17
How to handle the storage categories of the locations in Odoo 17
Celine George
How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17How to Identify the Margin from the Sales Orders using Odoo 17
How to Identify the Margin from the Sales Orders using Odoo 17
Celine George
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷sField Parameters in Odoo 18 - Odoo 18 際際滷s
Field Parameters in Odoo 18 - Odoo 18 際際滷s
Celine George
How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17How to Invoice Shipping Cost to Customer in Odoo 17
How to Invoice Shipping Cost to Customer in Odoo 17
Celine George
How to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of SaleHow to configure the retail shop in Odoo 17 Point of Sale
How to configure the retail shop in Odoo 17 Point of Sale
Celine George
How to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in OdooHow to process Interwarehouse and Intrawarehouse transfers in Odoo
How to process Interwarehouse and Intrawarehouse transfers in Odoo
Celine George
How to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of SaleHow to manage Customer Tips with Odoo 17 Point Of Sale
How to manage Customer Tips with Odoo 17 Point Of Sale
Celine George
Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18Analysis of Conf File Parameters in the Odoo 18
Analysis of Conf File Parameters in the Odoo 18
Celine George
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷sPurchase Analysis in Odoo 17 - Odoo 際際滷s
Purchase Analysis in Odoo 17 - Odoo 際際滷s
Celine George
Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17Analysis of Conf File Parameters in Odoo 17
Analysis of Conf File Parameters in Odoo 17
Celine George
How to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 WebsiteHow to Manage Check Out Process in Odoo 17 Website
How to Manage Check Out Process in Odoo 17 Website
Celine George
Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17Managing Online Signature and Payment with Odoo 17
Managing Online Signature and Payment with Odoo 17
Celine George
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷sRecruitment in the Odoo 17 - Odoo 17 際際滷s
Recruitment in the Odoo 17 - Odoo 17 際際滷s
Celine George
How to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting AppHow to Setup Company Data in Odoo 17 Accounting App
How to Setup Company Data in Odoo 17 Accounting App
Celine George
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷sHow to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
How to Install Odoo 18 with Pycharm - Odoo 18 際際滷s
Celine George
How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18How to Manage Purchase Order Approval in Odoo 18
How to Manage Purchase Order Approval in Odoo 18
Celine George
How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18How to Configure Outgoing and Incoming mail servers in Odoo 18
How to Configure Outgoing and Incoming mail servers in Odoo 18
Celine George

Recently uploaded (20)

PATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINES
PATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINESPATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINES
PATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINES
BananaIP Counsels
Developing Topic and Research Question for Systematic Reviews - Emmanuel Ekpor
Developing Topic and Research Question for Systematic Reviews - Emmanuel EkporDeveloping Topic and Research Question for Systematic Reviews - Emmanuel Ekpor
Developing Topic and Research Question for Systematic Reviews - Emmanuel Ekpor
Systematic Reviews Network (SRN)
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. DabhadeSynthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
BUSINESS QUIZ | THE QUIZ CLUB OF PSGCAS | 17TH MARCH 2025 .pptx
BUSINESS QUIZ | THE QUIZ CLUB OF PSGCAS | 17TH MARCH 2025 .pptxBUSINESS QUIZ | THE QUIZ CLUB OF PSGCAS | 17TH MARCH 2025 .pptx
BUSINESS QUIZ | THE QUIZ CLUB OF PSGCAS | 17TH MARCH 2025 .pptx
Quiz Club of PSG College of Arts & Science
nature and importance of Indian Knowledge System
nature and importance of Indian Knowledge Systemnature and importance of Indian Knowledge System
nature and importance of Indian Knowledge System
hanishabatra0
Anthelmintic Agent.pptx by Mrs. Manjushri P. Dabhade
Anthelmintic Agent.pptx by Mrs. Manjushri P. DabhadeAnthelmintic Agent.pptx by Mrs. Manjushri P. Dabhade
Anthelmintic Agent.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
The Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptxThe Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptx
SamarHosni3
Using GenAI for Universal Design for Learning
Using GenAI for Universal Design for LearningUsing GenAI for Universal Design for Learning
Using GenAI for Universal Design for Learning
Damian T. Gordon
A-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptx
A-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptxA-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptx
A-Z GENERAL QUIZ | THE QUIZ CLUB OF PSGCAS | 14TH MARCH 2025.pptx
Quiz Club of PSG College of Arts & Science
Code a Strategy on Pine Script With the Help of ChatGPT by Akshay Choudhary
Code a Strategy on Pine Script With the Help of ChatGPT by Akshay ChoudharyCode a Strategy on Pine Script With the Help of ChatGPT by Akshay Choudhary
Code a Strategy on Pine Script With the Help of ChatGPT by Akshay Choudhary
QuantInsti
PUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological HealthPUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological Health
Jonathan Hallett
PSD-I Exam Dumps: Your Key to Passing on the First Try
PSD-I Exam Dumps: Your Key to Passing on the First TryPSD-I Exam Dumps: Your Key to Passing on the First Try
PSD-I Exam Dumps: Your Key to Passing on the First Try
lethamcmullen
Test Bank Pharmacology 3rd Edition Brenner Stevens
Test Bank Pharmacology 3rd Edition Brenner  StevensTest Bank Pharmacology 3rd Edition Brenner  Stevens
Test Bank Pharmacology 3rd Edition Brenner Stevens
evakimworwa38
Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...
keshanf79
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptxBIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
maniramkumar
Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...
Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...
Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...
A Biodiction : A Unit of Dr. Divya Sharma
2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions
leigh441292
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. DabhadeCombinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...
TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...
TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...
Nguyen Thanh Tu Collection
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation FourthStrategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
keileyrazawi
PATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINES
PATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINESPATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINES
PATENTABILITY UNDER THE 2025 CRI DRAFT GUIDELINES
BananaIP Counsels
Developing Topic and Research Question for Systematic Reviews - Emmanuel Ekpor
Developing Topic and Research Question for Systematic Reviews - Emmanuel EkporDeveloping Topic and Research Question for Systematic Reviews - Emmanuel Ekpor
Developing Topic and Research Question for Systematic Reviews - Emmanuel Ekpor
Systematic Reviews Network (SRN)
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. DabhadeSynthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Synthesis for VIth SEM 21-2-25.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
nature and importance of Indian Knowledge System
nature and importance of Indian Knowledge Systemnature and importance of Indian Knowledge System
nature and importance of Indian Knowledge System
hanishabatra0
Anthelmintic Agent.pptx by Mrs. Manjushri P. Dabhade
Anthelmintic Agent.pptx by Mrs. Manjushri P. DabhadeAnthelmintic Agent.pptx by Mrs. Manjushri P. Dabhade
Anthelmintic Agent.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
The Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptxThe Effectiveness of Manual Therapies on the Thoracic.pptx
The Effectiveness of Manual Therapies on the Thoracic.pptx
SamarHosni3
Using GenAI for Universal Design for Learning
Using GenAI for Universal Design for LearningUsing GenAI for Universal Design for Learning
Using GenAI for Universal Design for Learning
Damian T. Gordon
Code a Strategy on Pine Script With the Help of ChatGPT by Akshay Choudhary
Code a Strategy on Pine Script With the Help of ChatGPT by Akshay ChoudharyCode a Strategy on Pine Script With the Help of ChatGPT by Akshay Choudhary
Code a Strategy on Pine Script With the Help of ChatGPT by Akshay Choudhary
QuantInsti
PUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological HealthPUBH1000 際際滷s - Module 7: Ecological Health
PUBH1000 際際滷s - Module 7: Ecological Health
Jonathan Hallett
PSD-I Exam Dumps: Your Key to Passing on the First Try
PSD-I Exam Dumps: Your Key to Passing on the First TryPSD-I Exam Dumps: Your Key to Passing on the First Try
PSD-I Exam Dumps: Your Key to Passing on the First Try
lethamcmullen
Test Bank Pharmacology 3rd Edition Brenner Stevens
Test Bank Pharmacology 3rd Edition Brenner  StevensTest Bank Pharmacology 3rd Edition Brenner  Stevens
Test Bank Pharmacology 3rd Edition Brenner Stevens
evakimworwa38
Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...Mixed_Sinhala_Dual_Male_Names (1).pdf...
Mixed_Sinhala_Dual_Male_Names (1).pdf...
keshanf79
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptxBIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
BIOPHARMACEUTICS AND PHARMACOKINETICS(BP604T) - Copy (3).pptx
maniramkumar
Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...
Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...
Bioinformatics: History of Bioinformatics, Components of Bioinformatics, Geno...
A Biodiction : A Unit of Dr. Divya Sharma
2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions2. ES: Application of Number: Units of measure & conversions
2. ES: Application of Number: Units of measure & conversions
leigh441292
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. DabhadeCombinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Combinatorial_Chemistry.pptx by Mrs. Manjushri P. Dabhade
Dabhade madam Dabhade
TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...
TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...
TI LI畛U CHUYN SU L畛P 12 THEO CH働NG TRNH M畛I DNG CHO C畉 3 B畛 SCH N THI...
Nguyen Thanh Tu Collection
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation FourthStrategic Corporate Social Responsibility: Sustainable Value Creation Fourth
Strategic Corporate Social Responsibility: Sustainable Value Creation Fourth
keileyrazawi

How to Create Cohort View in Odoo 17 - Odoo 17 際際滷s

  • 1. How to Create Cohort View in Odoo 17 Enterprise
  • 2. Introduction Enterprise Odoo has a variety of view kinds, including list, form, tree, kanban, graph, pivot, calendar, cohort, and more. Cohort views are a kind of reporting view in Odoo that let us monitor and evaluate user behavior across time. Rows and columns are displayed in the cohort view. We may simply obtain data on a day-by-day, weekly, monthly, and annual basis by looking for the intersection of a row and column, which displays a specific metric or value for that cohort in that particular period.
  • 3. Enterprise To create a cohort view in Odoo, we need to define a model with the required fields
  • 4. Enterprise create a new model and add a menu action under the configuration tab. Below is python code for creating a new class in Odoo. class EmployeeDetails(models.Model): _name = 'employee.details' _description = 'Employee Details' _rec_name = "employee_id" employee_id = fields.Many2one('hr.employee', string="Employee") phone = fields.Char(related="employee_id.work_phone") email = fields.Char(related="employee_id.work_email") date = fields.Date(string="Date", required=True)
  • 5. Enterprise We can choose employees from hr.employee in the newly created class EmployeeDetails. Since the phone and email fields are configured as linked fields, they will immediately fill in when we choose employees. Added a date field and made it mandatory since the date in cohort view was set to date_stop.
  • 6. Enterprise Then, we need to give security for the above model. For that, create a new directory with a new csv file. Specify an id, name, and model id here. And give this security file in the manifest file. id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access.emp_details,access_emp_details,model_employee_details,base.group_user,1,1,1,1
  • 7. Enterprise Before creating a cohort view add web_cohort as a dependent module in the manifest file. Next, we can create an xml file to create a view. First, we want to create ir.actions.act.window model with model name employee.details, and here we need to specify the view mode which type required, below mentioned the view as tree, form, and cohort. And set an id employee_details_action_menu to provide menu action for our model and give this id as action in the menu item.
  • 8. Enterprise <record id="employee_details_action_menu" model="ir.actions.act_window"> <field name="name">Employee Details</field> <field name="res_model">employee.details</field> <field name="type">ir.actions.act_window</field> <field name="view_mode">tree,form,cohort</field> </record>
  • 9. Enterprise For creating a cohort view, first need to give an id for the record and specify the model as ir.ui.view. And give a field name and add the model as employee.details. After that, mention the desired string for cohort tag, set date_start as create date, then take the date_stop from the newly created module, and we can provide the interval as day, week, month and year, and here the mode is set as churn.
  • 10. Enterprise <record id="employee_details_view_cohort" model="ir.ui.view"> <field name="name">employee.details.view.cohort</field> <field name="model">employee.details</field> <field name="arch" type="xml"> <cohort string="Analysis" date_start="create_date" date_stop="date" interval="day" mode="churn"/> </field> </record>
  • 11. Enterprise Then set the menu action for the model. In the menu item tag, set action as the record id which is mentioned above, and set the parent where we want to show the menu item. <menuitem id="employee_details_menu_root" name="Employee Details" action="employee_details_action_menu" parent="hr.menu_config_employee" sequence="20"/>
  • 12. Enterprise We can see the Employee Details menu just click on that can see the details
  • 13. Enterprise Click on the menu, it will open a new model in the tree view format, where we can create new records.
  • 14. Enterprise Click on the cohort view icon and we can see the report of the records day wise in the UI.
  • 15. 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