From a77db24e1f88791d1d85699795664e0d46b52371 Mon Sep 17 00:00:00 2001 From: PicchiSeba Date: Wed, 26 Jun 2024 09:49:16 +0200 Subject: [PATCH] [FIX]base_geoengine: remove non-existent Sidebar and related functions --- .../views/geoengine/geoengine_controller.js | 99 +------------------ 1 file changed, 1 insertion(+), 98 deletions(-) diff --git a/base_geoengine/static/src/js/views/geoengine/geoengine_controller.js b/base_geoengine/static/src/js/views/geoengine/geoengine_controller.js index d8cb4f584a..7dedcd9cd6 100644 --- a/base_geoengine/static/src/js/views/geoengine/geoengine_controller.js +++ b/base_geoengine/static/src/js/views/geoengine/geoengine_controller.js @@ -9,18 +9,13 @@ odoo.define("base_geoengine.GeoengineController", function (require) { /** * The Geoengine Controller controls the geo renderer and the geo model. - * Its role is to allow these two components to communicate properly, and - * also, to render and bind all extra actions in the 'Sidebar'. + * Its role is to allow these two components to communicate properly. */ - var core = require("web.core"); var BasicController = require("web.BasicController"); var pyUtils = require("web.py_utils"); - var Sidebar = require("web.Sidebar"); var DataExport = require("web.DataExport"); - var _t = core._t; - var GeoengineController = BasicController.extend({ custom_events: _.extend({}, BasicController.prototype.custom_events, { selection_changed: "_onSelectionChanged", @@ -31,13 +26,11 @@ odoo.define("base_geoengine.GeoengineController", function (require) { * @override * @param {Object} parent node * @param {Boolean} params.editable - * @param {Boolean} params.hasSidebar * @param {Object} params.toolbarActions * @param {Boolean} params.noLeaf */ init: function (parent, model, renderer, params) { this._super.apply(this, arguments); - this.hasSidebar = params.hasSidebar; this.toolbarActions = params.toolbarActions || {}; this.noLeaf = params.noLeaf; this.selectedRecords = params.selectedRecords || []; @@ -106,55 +99,6 @@ odoo.define("base_geoengine.GeoengineController", function (require) { }); }, - /** - * Render the sidebar (the 'action' menu in the control panel, right of - * the main buttons) - * - * @param {jQuery.Element} $node - */ - renderSidebar: function ($node) { - if (this.hasSidebar && !this.sidebar) { - var other = [ - { - label: _t("Export"), - callback: this._onExportData.bind(this), - }, - ]; - if (this.archiveEnabled) { - other.push({ - label: _t("Archive"), - callback: this._onToggleArchiveState.bind(this, true), - }); - other.push({ - label: _t("Unarchive"), - callback: this._onToggleArchiveState.bind(this, false), - }); - } - if (this.is_action_enabled("delete")) { - other.push({ - label: _t("Delete"), - callback: this._onDeleteSelectedRecords.bind(this), - }); - } - this.sidebar = new Sidebar(this, { - editable: this.is_action_enabled("edit"), - env: { - context: this.model - .get(this.handle, { - raw: true, - }) - .getContext(), - activeIds: this.getSelectedIds(), - model: this.modelName, - }, - actions: _.extend(this.toolbarActions, {other: other}), - }); - this.sidebar.appendTo($node); - - this._toggleSidebar(); - } - }, - /** * Overrides to update the list of selected records * @@ -244,51 +188,10 @@ odoo.define("base_geoengine.GeoengineController", function (require) { .then(this.update.bind(this, {}, {reload: false})); }, - /** - * @override - * @private - */ - _getSidebarEnv: function () { - var env = this._super.apply(this, arguments); - var record = this.model.get(this.handle); - return _.extend(env, {domain: record.getDomain()}); - }, - - /** - * Display the sidebar (the 'action' menu in the control panel) - * if we have some selected records. - */ - _toggleSidebar: function () { - if (this.sidebar) { - this.sidebar.do_toggle(this.selectedRecords.length > 0); - } - }, - - /** - * @override - * @returns {Deferred} - */ - _update: function () { - this._toggleSidebar(); - return this._super.apply(this, arguments); - }, - // -------------------------------------------------------------------- // Handlers // -------------------------------------------------------------------- - /** - * When the current selection changes (by clicking on the checkboxes on - * the left), we need to display (or hide) the 'sidebar'. - * - * @private - * @param {OdooEvent} event - */ - _onSelectionChanged: function (event) { - this.selectedRecords = event.data.selection; - this._toggleSidebar(); - }, - /** * Called when clicking on 'Archive' or 'Unarchive' in the sidebar. *