diff --git a/restrict_web_debug/README.rst b/restrict_web_debug/README.rst new file mode 100644 index 000000000..2ac56617b --- /dev/null +++ b/restrict_web_debug/README.rst @@ -0,0 +1,44 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Userwise Developer Mode Restriction +=================================== +* Restrict Developer Mode for Specific Users with Disable Developer Mode options + +Configuration +============ +- No configuration needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +AFFERO General Public License, Version 3 (AGPL v3). +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V15) Mohammed Dilshad Tk, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/restrict_web_debug/__init__.py b/restrict_web_debug/__init__.py new file mode 100644 index 000000000..eb7553588 --- /dev/null +++ b/restrict_web_debug/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models diff --git a/restrict_web_debug/__manifest__.py b/restrict_web_debug/__manifest__.py new file mode 100644 index 000000000..cf53ce188 --- /dev/null +++ b/restrict_web_debug/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Userwise Developer Mode Restriction', + 'version': '15.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'This module allows the hiding of the debug option based on' + ' user-specific settings', + "description": 'Restrict developer mode for each users with disabling an ' + '"Show debug icon" user group, then user could not able to ' + 'access debug mode.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['web'], + 'data': [ + 'security/restrict_web_debug_groups.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'restrict_web_debug/static/src/js/DebugMenuBasic.js', + ], + 'web.assets_qweb': [ + 'restrict_web_debug/static/src/xml/restrict_debug_templates.xml', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install ': False, + 'application': False, +} diff --git a/restrict_web_debug/doc/RELEASE_NOTES.md b/restrict_web_debug/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..80c210c7e --- /dev/null +++ b/restrict_web_debug/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 21.11.2023 +#### Version 15.0.1.0.0 +#### ADD + +- Initial Commit for Userwise Developer Mode Restriction diff --git a/restrict_web_debug/models/__init__.py b/restrict_web_debug/models/__init__.py new file mode 100644 index 000000000..d11c9522c --- /dev/null +++ b/restrict_web_debug/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import ir_http diff --git a/restrict_web_debug/models/ir_http.py b/restrict_web_debug/models/ir_http.py new file mode 100644 index 000000000..432348582 --- /dev/null +++ b/restrict_web_debug/models/ir_http.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import models + + +class IrHttp(models.AbstractModel): + """Inherits ir.http to add value in 'restrict_debug_mode' group of user + into session""" + _inherit = 'ir.http' + + def session_info(self): + """Set a value(user_group) to session values to access from js to hide + and show debug icon based on user enable or disable the group.""" + info = super().session_info() + info["user_group"] = self.env.user.has_group('restrict_web_debug.' + 'restrict_debug_mode') + return info diff --git a/restrict_web_debug/security/restrict_web_debug_groups.xml b/restrict_web_debug/security/restrict_web_debug_groups.xml new file mode 100644 index 000000000..eac0a465b --- /dev/null +++ b/restrict_web_debug/security/restrict_web_debug_groups.xml @@ -0,0 +1,9 @@ + + + + + Show Debug Icon + + + diff --git a/restrict_web_debug/static/description/assets/icons/check.png b/restrict_web_debug/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/check.png differ diff --git a/restrict_web_debug/static/description/assets/icons/chevron.png b/restrict_web_debug/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/chevron.png differ diff --git a/restrict_web_debug/static/description/assets/icons/cogs.png b/restrict_web_debug/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/cogs.png differ diff --git a/restrict_web_debug/static/description/assets/icons/consultation.png b/restrict_web_debug/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/consultation.png differ diff --git a/restrict_web_debug/static/description/assets/icons/ecom-black.png b/restrict_web_debug/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/ecom-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/education-black.png b/restrict_web_debug/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/education-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/hotel-black.png b/restrict_web_debug/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/hotel-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/license.png b/restrict_web_debug/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/license.png differ diff --git a/restrict_web_debug/static/description/assets/icons/lifebuoy.png b/restrict_web_debug/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/lifebuoy.png differ diff --git a/restrict_web_debug/static/description/assets/icons/manufacturing-black.png b/restrict_web_debug/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/manufacturing-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/pos-black.png b/restrict_web_debug/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/pos-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/puzzle.png b/restrict_web_debug/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/puzzle.png differ diff --git a/restrict_web_debug/static/description/assets/icons/restaurant-black.png b/restrict_web_debug/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/restaurant-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/service-black.png b/restrict_web_debug/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/service-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/trading-black.png b/restrict_web_debug/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/trading-black.png differ diff --git a/restrict_web_debug/static/description/assets/icons/training.png b/restrict_web_debug/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/training.png differ diff --git a/restrict_web_debug/static/description/assets/icons/update.png b/restrict_web_debug/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/update.png differ diff --git a/restrict_web_debug/static/description/assets/icons/user.png b/restrict_web_debug/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/user.png differ diff --git a/restrict_web_debug/static/description/assets/icons/wrench.png b/restrict_web_debug/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/restrict_web_debug/static/description/assets/icons/wrench.png differ diff --git a/restrict_web_debug/static/description/assets/misc/categories.png b/restrict_web_debug/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/categories.png differ diff --git a/restrict_web_debug/static/description/assets/misc/check-box.png b/restrict_web_debug/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/check-box.png differ diff --git a/restrict_web_debug/static/description/assets/misc/compass.png b/restrict_web_debug/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/compass.png differ diff --git a/restrict_web_debug/static/description/assets/misc/corporate.png b/restrict_web_debug/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/corporate.png differ diff --git a/restrict_web_debug/static/description/assets/misc/customer-support.png b/restrict_web_debug/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/customer-support.png differ diff --git a/restrict_web_debug/static/description/assets/misc/cybrosys-logo.png b/restrict_web_debug/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/cybrosys-logo.png differ diff --git a/restrict_web_debug/static/description/assets/misc/features.png b/restrict_web_debug/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/features.png differ diff --git a/restrict_web_debug/static/description/assets/misc/logo.png b/restrict_web_debug/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/logo.png differ diff --git a/restrict_web_debug/static/description/assets/misc/pictures.png b/restrict_web_debug/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/pictures.png differ diff --git a/restrict_web_debug/static/description/assets/misc/pie-chart.png b/restrict_web_debug/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/pie-chart.png differ diff --git a/restrict_web_debug/static/description/assets/misc/right-arrow.png b/restrict_web_debug/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/right-arrow.png differ diff --git a/restrict_web_debug/static/description/assets/misc/star.png b/restrict_web_debug/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/star.png differ diff --git a/restrict_web_debug/static/description/assets/misc/support.png b/restrict_web_debug/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/support.png differ diff --git a/restrict_web_debug/static/description/assets/misc/whatsapp.png b/restrict_web_debug/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/restrict_web_debug/static/description/assets/misc/whatsapp.png differ diff --git a/restrict_web_debug/static/description/assets/modules/auto_database_backup.gif b/restrict_web_debug/static/description/assets/modules/auto_database_backup.gif new file mode 100644 index 000000000..591c8b18d Binary files /dev/null and b/restrict_web_debug/static/description/assets/modules/auto_database_backup.gif differ diff --git a/restrict_web_debug/static/description/assets/modules/hide_menu_user.png b/restrict_web_debug/static/description/assets/modules/hide_menu_user.png new file mode 100644 index 000000000..6bc155887 Binary files /dev/null and b/restrict_web_debug/static/description/assets/modules/hide_menu_user.png differ diff --git a/restrict_web_debug/static/description/assets/modules/multi_branch_base.png b/restrict_web_debug/static/description/assets/modules/multi_branch_base.png new file mode 100644 index 000000000..6f654cfdb Binary files /dev/null and b/restrict_web_debug/static/description/assets/modules/multi_branch_base.png differ diff --git a/restrict_web_debug/static/description/assets/modules/odoo_dynamic_dashboard.png b/restrict_web_debug/static/description/assets/modules/odoo_dynamic_dashboard.png new file mode 100644 index 000000000..3599974eb Binary files /dev/null and b/restrict_web_debug/static/description/assets/modules/odoo_dynamic_dashboard.png differ diff --git a/restrict_web_debug/static/description/assets/modules/odoo_website_helpdesk.png b/restrict_web_debug/static/description/assets/modules/odoo_website_helpdesk.png new file mode 100644 index 000000000..f19f3578e Binary files /dev/null and b/restrict_web_debug/static/description/assets/modules/odoo_website_helpdesk.png differ diff --git a/restrict_web_debug/static/description/assets/modules/web_login_styles.png b/restrict_web_debug/static/description/assets/modules/web_login_styles.png new file mode 100644 index 000000000..e20126a45 Binary files /dev/null and b/restrict_web_debug/static/description/assets/modules/web_login_styles.png differ diff --git a/restrict_web_debug/static/description/assets/screenshots/02.png b/restrict_web_debug/static/description/assets/screenshots/02.png new file mode 100644 index 000000000..21cb428cc Binary files /dev/null and b/restrict_web_debug/static/description/assets/screenshots/02.png differ diff --git a/restrict_web_debug/static/description/assets/screenshots/03.png b/restrict_web_debug/static/description/assets/screenshots/03.png new file mode 100644 index 000000000..f176f907e Binary files /dev/null and b/restrict_web_debug/static/description/assets/screenshots/03.png differ diff --git a/restrict_web_debug/static/description/assets/screenshots/04.png b/restrict_web_debug/static/description/assets/screenshots/04.png new file mode 100644 index 000000000..156142747 Binary files /dev/null and b/restrict_web_debug/static/description/assets/screenshots/04.png differ diff --git a/restrict_web_debug/static/description/assets/screenshots/heroImage.gif b/restrict_web_debug/static/description/assets/screenshots/heroImage.gif new file mode 100644 index 000000000..8e337e090 Binary files /dev/null and b/restrict_web_debug/static/description/assets/screenshots/heroImage.gif differ diff --git a/restrict_web_debug/static/description/assets/screenshots/o1.png b/restrict_web_debug/static/description/assets/screenshots/o1.png new file mode 100644 index 000000000..3e4817520 Binary files /dev/null and b/restrict_web_debug/static/description/assets/screenshots/o1.png differ diff --git a/restrict_web_debug/static/description/banner.png b/restrict_web_debug/static/description/banner.png new file mode 100644 index 000000000..2bae637bf Binary files /dev/null and b/restrict_web_debug/static/description/banner.png differ diff --git a/restrict_web_debug/static/description/icon.png b/restrict_web_debug/static/description/icon.png new file mode 100644 index 000000000..c68b4bc81 Binary files /dev/null and b/restrict_web_debug/static/description/icon.png differ diff --git a/restrict_web_debug/static/description/index.html b/restrict_web_debug/static/description/index.html new file mode 100644 index 000000000..4747f54a7 --- /dev/null +++ b/restrict_web_debug/static/description/index.html @@ -0,0 +1,600 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Userwise Developer Mode Restriction

+

+ Restrict Developer Mode for Specific Users.

+ + +
+
+
+
+ +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps to set the visibility of debug tool for specific users + based on the group. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Enable/Disable Debug Mode Group for Specific Users. +
+
+ + Based on the group debug tool will be shown. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Default preview when enable Debug Mode. +

+

+ Current view of debug tool without the custom module.

+ +
+
+

+ Enable Show Debug Mode group for the user. +

+

+ Debug Mode view when group enabled. To disable debug, disable group.

+ +

+ Then save the settings to disable Debug Mode(After the window reloads, the icon will be hidden).

+ +
+
+

+ Disable Show Debug Mode for the user. +

+

+ Debug Mode view after save the settings.

+ +
+
+
+ + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + +
+
+ +
+

+ Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+ +
+

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/restrict_web_debug/static/src/js/DebugMenuBasic.js b/restrict_web_debug/static/src/js/DebugMenuBasic.js new file mode 100644 index 000000000..e256dde1e --- /dev/null +++ b/restrict_web_debug/static/src/js/DebugMenuBasic.js @@ -0,0 +1,20 @@ +odoo.define('restrict_web_debug.debug_menu', function (require) { +"use strict"; + const { onMounted } = owl.hooks; + const { DebugMenuBasic } = require("@web/core/debug/debug_menu_basic"); + const { patch } = require('web.utils'); + const { useRef } = owl.hooks; + const session = require('web.session'); + /** Patch DebugMenuBasic to disable option of debug **/ + patch(DebugMenuBasic.prototype, "restrict_web_debug", { + setup() { + this._super(...arguments); + this.root = useRef("DebugDropDown"); + onMounted(() => { + if (session.user_group == false) { + $(this.root.el).addClass("d-none") + } + }); + } + }) +}); diff --git a/restrict_web_debug/static/src/xml/restrict_debug_templates.xml b/restrict_web_debug/static/src/xml/restrict_debug_templates.xml new file mode 100644 index 000000000..0f37e35b2 --- /dev/null +++ b/restrict_web_debug/static/src/xml/restrict_debug_templates.xml @@ -0,0 +1,10 @@ + + + + + + DebugDropDown + + +