mirror of
https://github.com/SARL-PACIFIC-ERP/odoo-sh-test.git
synced 2025-06-25 09:32:22 +00:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import { Component, useState } from "@odoo/owl";
|
|
import { registry } from "@web/core/registry";
|
|
import { Layout } from "@web/search/layout";
|
|
import { useService } from "@web/core/utils/hooks"
|
|
import { DashboardItem } from "./dashboard_item/dashboard_item";
|
|
import { Piechart } from "./piechart/piechart";
|
|
|
|
class AwesomeDashboard extends Component {
|
|
static template = "awesome_dashboard.AwesomeDashboard";
|
|
static components = { Layout, DashboardItem, Piechart};
|
|
|
|
setup() {
|
|
this.display = {
|
|
controlPanel: {},
|
|
};
|
|
|
|
this.action = useService("action");
|
|
|
|
this.stats = useState(useService('awesome_dashboard.statistics'));
|
|
}
|
|
|
|
openCustomers() {
|
|
this.action.doAction("base.action_partner_form");
|
|
}
|
|
|
|
openLeads() {
|
|
this.action.doAction({
|
|
type: 'ir.actions.act_window',
|
|
name: 'Leads',
|
|
res_model: 'crm.lead',
|
|
views: [[false, 'tree'],[false, 'form']],
|
|
});
|
|
}
|
|
}
|
|
|
|
registry.category("lazy_components").add("AwesomeDashboard", AwesomeDashboard); |