Skip to content

Commit 3ef1bf3

Browse files
committed
[18.0][FIX] web_responsive: fix modules paths
1 parent 4324b3a commit 3ef1bf3

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

web_responsive/static/src/components/menu_canonical_searchbar/searchbar.esm.js

+20-4
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,30 @@ export class AppsMenuCanonicalSearchBar extends Component {
109109
const searchField = (item) => item.displayName;
110110
// Update search results paths
111111
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+
}
114122
}
115123
for (const item in this.subMenuItems) {
116124
for (const root in this.rootMenuItems) {
117125
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+
}
120136
}
121137
}
122138
}

0 commit comments

Comments
 (0)