in odoo 17 Getting OwlError: Invalid handler (expected a function, received: 'undefined')

40 Views Asked by At

Using POS product of Odoo 17 I am trying to add one more item in burger icon menubar in navbar. I am successfully added the item "Admin Panel" and now I wan too just call the function when user click on the that "Admin Panel".

But it continuously giving error

I want when user click on the "Admin Panel" then simply call the function.

this is my topper.js file

/** @odoo-module */
import { patch } from "@web/core/utils/patch";
import { Navbar } from "@point_of_sale/app/navbar/navbar";
//import { v4 as uuidv4 } from 'uuid';


Navbar.template = "pos_top_message.TopbarExtension"
patch(Navbar.prototype, {
    setup() {
        super.setup();
    },
});

odoo.define("pos_top_message.topbar",[],function(require){
    'use strict'
    console.log("Hello odoo..")
    var adminPanel = function(){
        console.log("Kalu mathalu");
    };
    adminPanel();
});

this is my view/pos_top_message.xml file:

     <li class="menu-item navbar-button" t-on-click="adminPanel">
         <a class="dropdown-item py-2">
             Admin Panel
         </a>
     </li>

and I am getting error:

OwlError: Invalid handler (expected a function, received: 'undefined') OwlError@ mainEventHandler@http://localhost:8069/web/assets/3/efce9ad/point_of_sale.assets_prod.min.js:1565:112 listener@http://localhost:8069/web/assets/3/efce9ad/point_of_sale.assets_prod.min.js:742:31

0

There are 0 best solutions below