Skip to content

Commit 3b7f9c8

Browse files
committed
[FIX]base_geoengine: replace old web.Sidebar w/ web.ActionMenus
1 parent d9d9a3b commit 3b7f9c8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

base_geoengine/static/src/js/views/geoengine/geoengine_controller.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
1010
/**
1111
* The Geoengine Controller controls the geo renderer and the geo model.
1212
* Its role is to allow these two components to communicate properly, and
13-
* also, to render and bind all extra actions in the 'Sidebar'.
13+
* also, to render and bind all extra actions in the 'ActionMenus'.
1414
*/
1515

1616
var core = require("web.core");
1717
var BasicController = require("web.BasicController");
1818
var pyUtils = require("web.py_utils");
19-
var Sidebar = require("web.Sidebar");
19+
var ActionMenus = require("web.ActionMenus");
2020
var DataExport = require("web.DataExport");
2121

2222
var _t = core._t;
@@ -31,13 +31,13 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
3131
* @override
3232
* @param {Object} parent node
3333
* @param {Boolean} params.editable
34-
* @param {Boolean} params.hasSidebar
34+
* @param {Boolean} params.hasActionMenus
3535
* @param {Object} params.toolbarActions
3636
* @param {Boolean} params.noLeaf
3737
*/
3838
init: function (parent, model, renderer, params) {
3939
this._super.apply(this, arguments);
40-
this.hasSidebar = params.hasSidebar;
40+
this.hasActionMenus = params.hasActionMenus;
4141
this.toolbarActions = params.toolbarActions || {};
4242
this.noLeaf = params.noLeaf;
4343
this.selectedRecords = params.selectedRecords || [];
@@ -112,8 +112,8 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
112112
*
113113
* @param {jQuery.Element} $node
114114
*/
115-
renderSidebar: function ($node) {
116-
if (this.hasSidebar && !this.sidebar) {
115+
renderActionMenus: function ($node) {
116+
if (this.hasActionMenus && !this.sidebar) {
117117
var other = [
118118
{
119119
label: _t("Export"),
@@ -136,7 +136,7 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
136136
callback: this._onDeleteSelectedRecords.bind(this),
137137
});
138138
}
139-
this.sidebar = new Sidebar(this, {
139+
this.sidebar = new ActionMenus(this, {
140140
editable: this.is_action_enabled("edit"),
141141
env: {
142142
context: this.model
@@ -151,7 +151,7 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
151151
});
152152
this.sidebar.appendTo($node);
153153

154-
this._toggleSidebar();
154+
this._toggleActionMenus();
155155
}
156156
},
157157

@@ -248,7 +248,7 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
248248
* @override
249249
* @private
250250
*/
251-
_getSidebarEnv: function () {
251+
_getActionMenusEnv: function () {
252252
var env = this._super.apply(this, arguments);
253253
var record = this.model.get(this.handle);
254254
return _.extend(env, {domain: record.getDomain()});
@@ -258,7 +258,7 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
258258
* Display the sidebar (the 'action' menu in the control panel)
259259
* if we have some selected records.
260260
*/
261-
_toggleSidebar: function () {
261+
_toggleActionMenus: function () {
262262
if (this.sidebar) {
263263
this.sidebar.do_toggle(this.selectedRecords.length > 0);
264264
}
@@ -269,7 +269,7 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
269269
* @returns {Deferred}
270270
*/
271271
_update: function () {
272-
this._toggleSidebar();
272+
this._toggleActionMenus();
273273
return this._super.apply(this, arguments);
274274
},
275275

@@ -286,7 +286,7 @@ odoo.define("base_geoengine.GeoengineController", function (require) {
286286
*/
287287
_onSelectionChanged: function (event) {
288288
this.selectedRecords = event.data.selection;
289-
this._toggleSidebar();
289+
this._toggleActionMenus();
290290
},
291291

292292
/**

0 commit comments

Comments
 (0)