I am very bad at JS. I want to add a systray menu next to 'switch company'. I have managed to get the information from a python file, but I would like it to have the same functionality as 'switch company'. In other words, when I click on one of the submenus of my 'Fiscal Period' they replace the original. This is for odoo 15. I need your help plss
JS code:
/** @odoo-module **/
import { registry } from"@web/core/registry";
const { Component, hooks } = owl;
const { useState } = hooks;constrpc = require('web.rpc');
export classFiscalPeriod extends Component {
async willStart() {
varself = this;
this.ejemplo = 1;
this.data = rpc.query({
model:'account.fiscal.year',
method:'get_not_accepted',
args: [''],
}).then(function(res){
console.log(res);
console.log("entré aquí 4");
self.data = res
})}
FiscalPeriod.template = "account_accountan.fiscal_period";
export const systrayItem = {
Component:FiscalPeriod,
};registry.category("systray").add("FiscalPeriod", systrayItem, { sequence:1000 });