mirror of
https://github.com/SARL-PACIFIC-ERP/odoo-sh-test.git
synced 2025-06-25 09:32:22 +00:00
ch2.2 Add some buttons for quick navigation
This commit is contained in:
parent
8217053199
commit
ef7fb887b7
|
@ -3,6 +3,7 @@
|
||||||
import { Component } from "@odoo/owl";
|
import { Component } from "@odoo/owl";
|
||||||
import { registry } from "@web/core/registry";
|
import { registry } from "@web/core/registry";
|
||||||
import { Layout } from "@web/search/layout";
|
import { Layout } from "@web/search/layout";
|
||||||
|
import { useService } from "@web/core/utils/hooks"
|
||||||
|
|
||||||
class AwesomeDashboard extends Component {
|
class AwesomeDashboard extends Component {
|
||||||
static template = "awesome_dashboard.AwesomeDashboard";
|
static template = "awesome_dashboard.AwesomeDashboard";
|
||||||
|
@ -12,6 +13,21 @@ class AwesomeDashboard extends Component {
|
||||||
this.display = {
|
this.display = {
|
||||||
controlPanel: {},
|
controlPanel: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.action = useService("action");
|
||||||
|
}
|
||||||
|
|
||||||
|
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']],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
|
|
||||||
<t t-name="awesome_dashboard.AwesomeDashboard">
|
<t t-name="awesome_dashboard.AwesomeDashboard">
|
||||||
<Layout display="display" className="'o_dashboard h-100'">
|
<Layout display="display" className="'o_dashboard h-100'">
|
||||||
|
<t t-set-slot="layout-buttons">
|
||||||
|
<button class="btn btn-primary" t-on-click="openCustomers">Customers</button>
|
||||||
|
<button class="btn btn-primary" t-on-click="openLeads">Leads</button>
|
||||||
|
</t>
|
||||||
</Layout>
|
</Layout>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue