[IMP] web_disable_export_group: black, isort, prettier

This commit is contained in:
João Marques
2020-10-20 08:53:33 +01:00
committed by David
parent a67fcc798f
commit 1afdc79e56
6 changed files with 56 additions and 53 deletions

View File

@@ -2,7 +2,7 @@
Copyright 2018 Tecnativa - David Vidal
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). */
odoo.define("web_disable_export_group", function(require) {
"use strict";
"use strict";
var core = require("web.core");
var Sidebar = require("web.Sidebar");
@@ -10,10 +10,15 @@ odoo.define("web_disable_export_group", function(require) {
var _t = core._t;
Sidebar.include({
_addItems: function (sectionCode, items) {
_addItems: function(sectionCode, items) {
var _items = items;
if (!session.is_superuser && sectionCode === 'other' && items.length && !session.group_export_data) {
_items = _.reject(_items, {label:_t("Export")});
if (
!session.is_superuser &&
sectionCode === "other" &&
items.length &&
!session.group_export_data
) {
_items = _.reject(_items, {label: _t("Export")});
}
this._super(sectionCode, _items);
},