diff --git a/awesome_dashboard/static/src/dashboard.js b/awesome_dashboard/static/src/dashboard.js index 2c6cce4..c178ee2 100644 --- a/awesome_dashboard/static/src/dashboard.js +++ b/awesome_dashboard/static/src/dashboard.js @@ -1,6 +1,6 @@ /** @odoo-module **/ -import { Component } from "@odoo/owl"; +import { Component, onWillStart } from "@odoo/owl"; import { registry } from "@web/core/registry"; import { Layout } from "@web/search/layout"; import { useService } from "@web/core/utils/hooks" @@ -16,6 +16,11 @@ class AwesomeDashboard extends Component { }; this.action = useService("action"); + + this.rpc = useService('rpc'); + onWillStart(async () => { + this.stats = await this.rpc("/awesome_dashboard/statistics"); + }); } openCustomers() { diff --git a/awesome_dashboard/static/src/dashboard.xml b/awesome_dashboard/static/src/dashboard.xml index 980b39f..3ac9eec 100644 --- a/awesome_dashboard/static/src/dashboard.xml +++ b/awesome_dashboard/static/src/dashboard.xml @@ -2,15 +2,55 @@ + + + + + Total amount of new orders this month + + + + + + + +
- - That's a bigger one - + + Number of new orders this month +
+ +
+
+ + Total amount of new orders this month +
+ +
+
+ + Average amount of t-shirt by order this month +
+ +
+
+ + Number of cancelled orders this month +
+ +
+
+ + Average time for an order to go from ‘new’ to ‘sent’ or ‘cancelled’ +
+ +
+