File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 11from odoo import models , fields
22
3+
34class EstateMove (models .Model ):
45 _inherit = "account.move"
56
Original file line number Diff line number Diff line change @@ -33,4 +33,3 @@ def get_statistics(self):
3333 },
3434 'total_amount' : random .randint (100 , 1000 )
3535 }
36-
Original file line number Diff line number Diff line change 11import { Component } from "@odoo/owl" ;
22import { registry } from "@web/core/registry" ;
33import { Layout } from "@web/search/layout" ;
4+ import { useService } from "@web/core/utils/hooks" ;
45
56class AwesomeDashboard extends Component {
67 static template = "awesome_dashboard.AwesomeDashboard" ;
78 static components = { Layout } ;
89
910 setup ( ) {
11+ this . action = useService ( "action" ) ;
1012 this . display = {
1113 controlPanel : { } ,
1214 } ;
15+
16+ this . openCustomerView = ( ) => {
17+ this . action . doAction ( "base.action_partner_form" ) ;
18+ }
19+
20+ this . openLeads = ( ) => {
21+ this . action . doAction ( {
22+ type : "ir.actions.act_window" ,
23+ name : "All leads" ,
24+ res_model : "crm.lead" ,
25+ views : [
26+ [ false , "list" ] ,
27+ [ false , "form" ] ,
28+ ] ,
29+ } ) ;
30+ }
1331 }
1432}
1533
Original file line number Diff line number Diff line change 44 <t t-name =" awesome_dashboard.AwesomeDashboard" >
55 <Layout display =" display" className =" 'o_dashboard h-100'" >
66 <t t-set-slot =" layout-buttons" >
7- Hello dashboard
7+ <button class =" btn btn-primary" t-on-click =" openCustomerView" >Customers</button >
8+ <button class =" btn btn-primary" t-on-click =" openLeads" >Leads</button >
89 </t >
910 some content
1011 </Layout >
You can’t perform that action at this time.
0 commit comments