1
- import { Component , onWillStart , useState } from "@odoo/owl" ;
1
+ import { Component , useState } from "@odoo/owl" ;
2
2
import { registry } from "@web/core/registry" ;
3
3
import { Layout } from "@web/search/layout" ;
4
4
import { useService } from "@web/core/utils/hooks" ;
5
5
import { DashboardItem } from "./dashboard_item" ;
6
- import { ConfigDialog } from "./config_dialog" ;
7
- import { browser } from "@web/core/browser/browser" ;
6
+ import { ConfigDialog } from "./config_dialog/config_dialog" ;
8
7
import { _t } from "@web/core/l10n/translation" ;
8
+ import { user } from "@web/core/user" ;
9
9
10
10
class AwesomeDashboard extends Component {
11
11
static template = "awesome_dashboard.AwesomeDashboard" ;
@@ -15,9 +15,9 @@ class AwesomeDashboard extends Component {
15
15
this . result = useState ( useService ( "awesome_dashboard.statistics" ) ) ;
16
16
this . items = registry . category ( "awesome_dashboard" ) . getAll ( ) ;
17
17
this . dialog = useService ( "dialog" ) ;
18
- // retreive disabled items
18
+
19
19
this . state = useState ( {
20
- disabledItems : browser . localStorage . getItem ( "disabledItems" ) ?. split ( "," ) || [ ]
20
+ disabledItems : user . settings . disabled_items || [ ] ,
21
21
} ) ;
22
22
}
23
23
openCustomers ( ) {
@@ -33,6 +33,7 @@ class AwesomeDashboard extends Component {
33
33
// update the list of disabeled items
34
34
updateConfigs ( newDisabledItems ) {
35
35
this . state . disabledItems = newDisabledItems ;
36
+ user . setUserSettings ( "disabled_items" , this . state . disabledItems )
36
37
}
37
38
38
39
openLeads ( ) {
0 commit comments