SlideShare a Scribd company logo
How to Add New Item in
CogMenu in Odoo 18
Enterprise
Enterprise
Introduction
In Odoo 18, CogMenu (or Configuration Menu) is a feature typically
found in various modules that allows users to configure settings
related to that specific module. It has a cogwheel like icon usually
located on the top left side of the screen. By default, the features for
Importing and Exporting will be available inside the menu.
Enterprise
Let’s take the example from the Sales module of Odoo 18. The
CogMenu that we can see there is
Enterprise
To create a new custom menu inside this Cogmenu of Odoo 17,
we can just create a new module which will have a structure like
Enterprise
The file cog_menu.js have the javascript code
/**@odoo-module **/
import { DropdownItem } from "@web/core/dropdown/dropdown_item";
import { registry } from "@web/core/registry";
const { Component } = owl;
const cogMenuRegistry = registry.category("cogMenu");
export class CogMenu extends Component {
setup() {
super.setup(...arguments);
this.notificationService = useService("notification");
}
async actionCustomMenu() {
this.notificationService.add(_t("Success message test"), {
title: "Success",
type: "success"
});
// Include your action for the menu here...}
}
CogMenu.template = "cog_menu_item.NewOption";
CogMenu.components = { DropdownItem };
export const CogMenuItem = {
Component: CogMenu,
groupNumber: 20,
isDisplayed: ({ config }) => config.viewType != "form",};
cogMenuRegistry.add("custom-menu", CogMenuItem, { sequence: 10 });
Enterprise
The file cog_menu.xml have the xml code
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="cog_menu_item.NewOption" owl="1">
<DropdownItem class="'o_cog_menu'" onSelected.bind="actionCustomMenu">
Custom Menu
</DropdownItem>
</t>
</templates>
Enterprise
This will display the new menu item on the Cog menu as
Enterprise
We have written the bind method js code for the menu to show a
simple success message test. So, on clicking the new menu item, we
can see
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

More from Celine George (20)

PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPTX
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
Controller Request and Response in Odoo18
Celine George
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
Difference between write and update in odoo 18
Celine George
 
PPTX
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PPTX
How to Manage Expiry Date in Odoo 18 Inventory
Celine George
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
How to Manage Access Rights & User Types in Odoo 18
Celine George
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Controller Request and Response in Odoo18
Celine George
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Difference between write and update in odoo 18
Celine George
 
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
How to Manage Expiry Date in Odoo 18 Inventory
Celine George
 

Recently uploaded (20)

PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Ad

How to Add New Item in CogMenu in Odoo 18

  • 1. How to Add New Item in CogMenu in Odoo 18 Enterprise
  • 2. Enterprise Introduction In Odoo 18, CogMenu (or Configuration Menu) is a feature typically found in various modules that allows users to configure settings related to that specific module. It has a cogwheel like icon usually located on the top left side of the screen. By default, the features for Importing and Exporting will be available inside the menu.
  • 3. Enterprise Let’s take the example from the Sales module of Odoo 18. The CogMenu that we can see there is
  • 4. Enterprise To create a new custom menu inside this Cogmenu of Odoo 17, we can just create a new module which will have a structure like
  • 5. Enterprise The file cog_menu.js have the javascript code /**@odoo-module **/ import { DropdownItem } from "@web/core/dropdown/dropdown_item"; import { registry } from "@web/core/registry"; const { Component } = owl; const cogMenuRegistry = registry.category("cogMenu"); export class CogMenu extends Component { setup() { super.setup(...arguments); this.notificationService = useService("notification"); } async actionCustomMenu() { this.notificationService.add(_t("Success message test"), { title: "Success", type: "success" }); // Include your action for the menu here...} } CogMenu.template = "cog_menu_item.NewOption"; CogMenu.components = { DropdownItem }; export const CogMenuItem = { Component: CogMenu, groupNumber: 20, isDisplayed: ({ config }) => config.viewType != "form",}; cogMenuRegistry.add("custom-menu", CogMenuItem, { sequence: 10 });
  • 6. Enterprise The file cog_menu.xml have the xml code <?xml version="1.0" encoding="UTF-8"?> <templates xml:space="preserve"> <t t-name="cog_menu_item.NewOption" owl="1"> <DropdownItem class="'o_cog_menu'" onSelected.bind="actionCustomMenu"> Custom Menu </DropdownItem> </t> </templates>
  • 7. Enterprise This will display the new menu item on the Cog menu as
  • 8. Enterprise We have written the bind method js code for the menu to show a simple success message test. So, on clicking the new menu item, we can see
  • 9. 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