Commit 10b51cc 1 parent 4324b3a commit 10b51cc Copy full SHA for 10b51cc
File tree 1 file changed +20
-4
lines changed
1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -109,14 +109,30 @@ export class AppsMenuCanonicalSearchBar extends Component {
109
109
const searchField = ( item ) => item . displayName ;
110
110
// Update search results paths
111
111
for ( const root in this . rootMenuItems ) {
112
- this . rootMenuItems [ root ] . path =
113
- `/odoo/${ this . rootMenuItems [ root ] . actionPath } ` ;
112
+ // Root is an app
113
+ if ( this . rootMenuItems [ root ] ?. actionPath ) {
114
+ this . rootMenuItems [ root ] . path =
115
+ `/odoo/${ this . rootMenuItems [ root ] . actionPath } ` ;
116
+ }
117
+ // Root is a module
118
+ else {
119
+ this . rootMenuItems [ root ] . path =
120
+ `/odoo/action-${ this . rootMenuItems [ root ] . actionID } ` ;
121
+ }
114
122
}
115
123
for ( const item in this . subMenuItems ) {
116
124
for ( const root in this . rootMenuItems ) {
117
125
if ( this . subMenuItems [ item ] . appID === this . rootMenuItems [ root ] . appID ) {
118
- this . subMenuItems [ item ] . path =
119
- `/odoo/${ this . rootMenuItems [ root ] . actionPath } /action-${ this . subMenuItems [ item ] . actionID } ` ;
126
+ // Root is an app
127
+ if ( this . rootMenuItems [ root ] ?. actionPath ) {
128
+ this . subMenuItems [ item ] . path =
129
+ `/odoo/${ this . rootMenuItems [ root ] . actionPath } /action-${ this . subMenuItems [ item ] . actionID } ` ;
130
+ }
131
+ // Root is a module
132
+ else {
133
+ this . subMenuItems [ item ] . path =
134
+ `/odoo/action-${ this . subMenuItems [ item ] . actionID } ` ;
135
+ }
120
136
}
121
137
}
122
138
}
You can’t perform that action at this time.
0 commit comments