Skip to content

Commit

Permalink
base_export_manager: js code was not migrated. Backport it from v15.0…
Browse files Browse the repository at this point in the history
…. Thanks to @nicomacr
  • Loading branch information
sebastienbeau committed Jan 29, 2025
1 parent 662d099 commit e8ef5a8
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions base_export_manager/static/src/js/base_export_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,23 @@
odoo.define("base_export_manager.base_export_manager", function (require) {
"use strict";

const core = require("web.core");
const Sidebar = require("web.Sidebar");
const ListController = require("web.ListController");
const session = require("web.session");

const _t = core._t;

Sidebar.include({
ListController.include({
/**
* Reject "export" item if the current user has not 'export perm' in
* the active model
*
* @override
* @private
* @returns {Promise}
*/
_addItems: function (sectionCode, items) {
let _items = items;
_getActionMenuItems: function () {
const is_export_enabled =
session.export_models.indexOf(this.env.model) !== -1;
if (
!session.is_system &&
sectionCode === "other" &&
items.length &&
!is_export_enabled
) {
_items = _.reject(_items, {label: _t("Export")});
session.export_models.indexOf(this.modelName) !== -1;
if (!session.is_system && !is_export_enabled) {
this.isExportEnable = false;
}
this._super(sectionCode, _items);
return this._super(...arguments);
},
});
});

0 comments on commit e8ef5a8

Please sign in to comment.