mirror of
https://github.com/SARL-PACIFIC-ERP/odoo-sh-test.git
synced 2025-06-25 09:32:22 +00:00
21 lines
618 B
JavaScript
21 lines
618 B
JavaScript
/** @odoo-module **/
|
|
|
|
import { registry } from "@web/core/registry";
|
|
import { reactive } from "@odoo/owl";
|
|
|
|
const statisticsService = {
|
|
dependencies: ["rpc"],
|
|
start(env, { rpc }) {
|
|
const statistics = reactive({ isReady: false });
|
|
async function loadData() {
|
|
const updates = await rpc("/awesome_dashboard/statistics");
|
|
Object.assign(statistics, updates, { isReady: true });
|
|
}
|
|
setInterval(loadData, 10*60*1000);
|
|
loadData();
|
|
return statistics;
|
|
},
|
|
};
|
|
|
|
|
|
registry.category("services").add("awesome_dashboard.statistics", statisticsService); |