import { registry } from "@web/core/registry"
import { KpiCard } from "./kpi_card/kpi_card"
import { ChartRenderer } from "./chart_renderer/chart_renderer"
import { loadJS } from "@web/core/assets"
import { useService } from "@web/core/utils/hooks"
import {getColor} from "@web/views/graph/colors"
const { Component, onWillStart, useRef, onMounted, useState } = owl
export class OwlSalesDashboard extends Component {
// top products
async getTopProducts () {
const data = await this.orm.readGroup("sale.report",[],['product_id', 'price_total'],['product_id'])
console.log(data)
this.state.topProducts = {
data: {
labels: data.map(d=>d.product_id[1]),
datasets: [
{
Label: 'Total',
data: data.map(d=>d.price_total),
hoverOffset: 4,
backgroundColor: data.map((_,index)=>getColor(index)),
},
{
Label: 'Count',
data: data.map(d=>d.product_id_count),
hoverOffset: 4
}]
}
}
}
this is my code for create a dashboard module in odoo .
when i use this line import {getColor} from “@web/views/graph/colors” for color , i got this error.
The following modules are needed by other modules but have not been defined, they may not be present in the correct asset bundle:
@web/views/graph/colors
The following modules could not be loaded because they have unmet dependencies, this is a secondary error which is likely caused by one of the above problems:
@my_dashboard/components/sales_dashboard
please give me correct solution