diff --git a/awesome_dashboard/static/src/dashboard/dashboard.js b/awesome_dashboard/static/src/dashboard/dashboard.js index 9a4370b..8c8a866 100644 --- a/awesome_dashboard/static/src/dashboard/dashboard.js +++ b/awesome_dashboard/static/src/dashboard/dashboard.js @@ -20,7 +20,7 @@ class AwesomeDashboard extends Component { this.stats = useState(useService('awesome_dashboard.statistics')); - this.items = items; + this.items = registry.category("awesome_dashboard").getAll(); } openCustomers() { diff --git a/awesome_dashboard/static/src/dashboard/dashboard_items.js b/awesome_dashboard/static/src/dashboard/dashboard_items.js index 224d57b..556005b 100644 --- a/awesome_dashboard/static/src/dashboard/dashboard_items.js +++ b/awesome_dashboard/static/src/dashboard/dashboard_items.js @@ -1,7 +1,9 @@ /** @odoo-module */ import { NumberCard } from "./number_card/number_card"; import { PieChartCard } from "./pie_chart_card/pie_chart_card"; -export const items = [ +import { registry } from "@web/core/registry"; + +const items = [ { id: "average_quantity", description: "Average amount of t-shirt", @@ -57,4 +59,9 @@ export const items = [ values: data.orders_by_size, }) } -] \ No newline at end of file + +] + +items.forEach(item => { + registry.category("awesome_dashboard").add(item.id, item); +}); \ No newline at end of file