diff --git a/web_disable_export_group/__manifest__.py b/web_disable_export_group/__manifest__.py index c26d7021d..9e1ac41dc 100644 --- a/web_disable_export_group/__manifest__.py +++ b/web_disable_export_group/__manifest__.py @@ -2,20 +2,13 @@ # Copyright 2018 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { - 'name': 'Web Disable Export Group', - 'version': '12.0.1.0.0', - 'license': 'AGPL-3', - 'author': 'Onestein, ' - 'Tecnativa, ' - 'Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/web', - 'category': 'Web', - 'depends': [ - 'web', - ], - 'data': [ - 'security/groups.xml', - 'templates/assets.xml', - ], - 'installable': True, + "name": "Web Disable Export Group", + "version": "12.0.1.0.0", + "license": "AGPL-3", + "author": "Onestein, " "Tecnativa, " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/web", + "category": "Web", + "depends": ["web",], + "data": ["security/groups.xml", "templates/assets.xml",], + "installable": True, } diff --git a/web_disable_export_group/models/ir_http.py b/web_disable_export_group/models/ir_http.py index 1ce239b40..5db53b9bc 100644 --- a/web_disable_export_group/models/ir_http.py +++ b/web_disable_export_group/models/ir_http.py @@ -6,13 +6,15 @@ from odoo.http import request class Http(models.AbstractModel): - _inherit = 'ir.http' + _inherit = "ir.http" def session_info(self): res = super(Http, self).session_info() user = request.env.user - res.update({ - 'group_export_data': user and user.has_group( - 'web_disable_export_group.group_export_data'), - }) + res.update( + { + "group_export_data": user + and user.has_group("web_disable_export_group.group_export_data"), + } + ) return res diff --git a/web_disable_export_group/security/groups.xml b/web_disable_export_group/security/groups.xml index 029d8e693..548e4c051 100644 --- a/web_disable_export_group/security/groups.xml +++ b/web_disable_export_group/security/groups.xml @@ -1,11 +1,12 @@ - + - Export Data - + - diff --git a/web_disable_export_group/static/src/js/disable_export_group.js b/web_disable_export_group/static/src/js/disable_export_group.js index 6c26f9e64..5411aae33 100644 --- a/web_disable_export_group/static/src/js/disable_export_group.js +++ b/web_disable_export_group/static/src/js/disable_export_group.js @@ -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); }, diff --git a/web_disable_export_group/templates/assets.xml b/web_disable_export_group/templates/assets.xml index 90d171c0d..ec5155977 100644 --- a/web_disable_export_group/templates/assets.xml +++ b/web_disable_export_group/templates/assets.xml @@ -1,11 +1,17 @@ - + -