File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
awesome_dashboard/static/src Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import { Component } from "@odoo/owl" ;
4
4
import { registry } from "@web/core/registry" ;
5
+ import { Layout } from "@web/search/layout" ;
6
+ import { useService } from "@web/core/utils/hooks" ;
5
7
6
8
class AwesomeDashboard extends Component {
7
9
static template = "awesome_dashboard.AwesomeDashboard" ;
10
+
11
+ setup ( ) {
12
+ this . action = useService ( "action" ) ;
13
+ //this.openSettings = this.openSettings.bind(this);
14
+ }
15
+ openCustomerList ( ) {
16
+ console . log ( 'clicked' ) ;
17
+ this . action . doAction ( "base.action_partner_form" ) ;
18
+ }
19
+ openLeadList ( ) {
20
+ console . log ( 'clicked' ) ;
21
+ this . action . doAction ( "crm.crm_lead_all_leads" ) ;
22
+ }
23
+
24
+ static components = { Layout } ;
8
25
}
9
26
10
27
registry . category ( "actions" ) . add ( "awesome_dashboard.dashboard" , AwesomeDashboard ) ;
Original file line number Diff line number Diff line change
1
+ .o_dashboard {
2
+ background-color : gray ;
3
+ }
Original file line number Diff line number Diff line change 2
2
<templates xml : space =" preserve" >
3
3
4
4
<t t-name =" awesome_dashboard.AwesomeDashboard" >
5
- hello dashboard
5
+ <Layout className =" 'o_dashboard h-100'" display =" { controlPanel: {}}" >
6
+ <t t-set-slot =" control-panel-create-button" >
7
+ <button type =" button" class =" btn btn-primary" t-on-click =" openCustomerList" >
8
+ Customers
9
+ </button >
10
+ </t >
11
+ <t t-set-slot =" control-panel-always-buttons" >
12
+ <button type =" button" class =" btn btn-primary" t-on-click =" openLeadList" >
13
+ Leads
14
+ </button >
15
+ </t >
16
+ </Layout >
6
17
</t >
7
18
8
19
</templates >
You can’t perform that action at this time.
0 commit comments