diff --git a/menu_lock/README.rst b/menu_lock/README.rst new file mode 100644 index 000000000..ee5541ded --- /dev/null +++ b/menu_lock/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Menu Lock in Odoo +================ +This module helps to lock menu items in odoo 15. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + +Credits +------- +* Developer: (V15) Mohamed Dilshad Tk, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://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 `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/menu_lock/__init__.py b/menu_lock/__init__.py new file mode 100644 index 000000000..3d9d81a9b --- /dev/null +++ b/menu_lock/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Muhammed Dilshad Tk() +# +# 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/menu_lock/__manifest__.py b/menu_lock/__manifest__.py new file mode 100644 index 000000000..dce6b0e3a --- /dev/null +++ b/menu_lock/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Muhammed Dilshad Tk() +# +# 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': 'Menu Lock in Odoo', + 'version': '15.0.1.0.0', + 'summary': """This Module will help to lock all the menu items""", + 'description': """User can choose the menus and set the password for lock + them""", + 'category': 'Extra Tools', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'images': ['static/description/banner.jpg'], + 'website': 'https://www.cybrosys.com', + 'depends': ['web', 'contacts'], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_users_views.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'menu_lock/static/src/js/lock_action.js', + 'menu_lock/static/src/css/menu_lock.css', + ], + 'web.assets_qweb': [ + 'menu_lock/static/src/xml/menu_lock.xml', + ], + }, + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/menu_lock/doc/RELEASE_NOTES.md b/menu_lock/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..7e54a3027 --- /dev/null +++ b/menu_lock/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 07.11.2024 +#### Version 15.0.1.0.0 +##### ADD + +- Initial commit for Menu Lock in Odoo diff --git a/menu_lock/models/__init__.py b/menu_lock/models/__init__.py new file mode 100644 index 000000000..4b10a2319 --- /dev/null +++ b/menu_lock/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Muhammed Dilshad Tk() +# +# 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 menu_password +from . import res_users diff --git a/menu_lock/models/menu_password.py b/menu_lock/models/menu_password.py new file mode 100644 index 000000000..b62b7e62f --- /dev/null +++ b/menu_lock/models/menu_password.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Muhammed Dilshad Tk() +# +# 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 . +# +############################################################################# +"""Menu Password""" +from odoo import fields, models + + +class MenuPassword(models.Model): + """Inverse model for one to many field of the model res users""" + _name = 'menu.password' + _description = 'Menus and Corresponding Locks for multiple password lock ' \ + 'conditions' + + menus_id = fields.Many2one('ir.ui.menu', string="Menus", + help='Select the menus to lock', + domain="[('parent_id','=',False)]") + password = fields.Char(string='Login Password', + help='Lock Password') + password_id = fields.Many2one('res.users', string='Password', + help='Inverse field to res user model') diff --git a/menu_lock/models/res_users.py b/menu_lock/models/res_users.py new file mode 100644 index 000000000..10cef4523 --- /dev/null +++ b/menu_lock/models/res_users.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies(). +# Author: Muhammed Dilshad Tk() +# +# 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 . +# +############################################################################# +"""Res Users Inherit""" +from odoo import api, fields, models + + +class ResUsers(models.Model): + """Inherited the res_users model for adding the fields for menu lock + setup.""" + _inherit = 'res.users' + + password_lock = fields.Selection( + [('single_password', 'Single Password Lock'), + ('multi_password', 'Multi Password Lock')], + string='Menu Lock Password Type', + help='Type of Menu Lock Password') + login_password = fields.Char(string='Login Password', help='Login Password') + menus_to_lock_ids = fields.Many2many('ir.ui.menu', string="Menus to lock", + domain="[('parent_id','=',False)]", + help='Select the menus to lock') + multi_lock_ids = fields.One2many('menu.password', 'password_id', + string='Multi menus to lock', + help='Multi lock menus and password') + + @api.model + def menu_lock_search(self, args): + """Method to returning values though args""" + user = self.env['res.users'].browse(args[0]) + return { + 'multi_lock_ids': [{ + 'id': menu.menus_id.id, + 'password': menu.password + } for menu in user.multi_lock_ids] + } + + @api.onchange('menus_to_lock_ids') + def _onchange_menus_to_lock_ids(self): + """Method to add fields from single password option to one-to-many of + multi password with same password in onchange of the field""" + if self.password_lock == 'single_password': + new_lines = [(5, 0, 0)] + for rec in self.menus_to_lock_ids: + new_lines.append( + (0, 0, {'menus_id': rec._origin.id, + 'password': self.login_password, + })) + self.write({'multi_lock_ids': new_lines}) diff --git a/menu_lock/security/ir.model.access.csv b/menu_lock/security/ir.model.access.csv new file mode 100644 index 000000000..8acf4f4b0 --- /dev/null +++ b/menu_lock/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_menu_password,access_menu_password,model_menu_password,base.group_user,1,1,1,1 diff --git a/menu_lock/static/description/assets/icons/check.png b/menu_lock/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/menu_lock/static/description/assets/icons/check.png differ diff --git a/menu_lock/static/description/assets/icons/chevron.png b/menu_lock/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/menu_lock/static/description/assets/icons/chevron.png differ diff --git a/menu_lock/static/description/assets/icons/cogs.png b/menu_lock/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/menu_lock/static/description/assets/icons/cogs.png differ diff --git a/menu_lock/static/description/assets/icons/consultation.png b/menu_lock/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/menu_lock/static/description/assets/icons/consultation.png differ diff --git a/menu_lock/static/description/assets/icons/ecom-black.png b/menu_lock/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/menu_lock/static/description/assets/icons/ecom-black.png differ diff --git a/menu_lock/static/description/assets/icons/education-black.png b/menu_lock/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/menu_lock/static/description/assets/icons/education-black.png differ diff --git a/menu_lock/static/description/assets/icons/hotel-black.png b/menu_lock/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/menu_lock/static/description/assets/icons/hotel-black.png differ diff --git a/menu_lock/static/description/assets/icons/license.png b/menu_lock/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/menu_lock/static/description/assets/icons/license.png differ diff --git a/menu_lock/static/description/assets/icons/lifebuoy.png b/menu_lock/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/menu_lock/static/description/assets/icons/lifebuoy.png differ diff --git a/menu_lock/static/description/assets/icons/manufacturing-black.png b/menu_lock/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/menu_lock/static/description/assets/icons/manufacturing-black.png differ diff --git a/menu_lock/static/description/assets/icons/pos-black.png b/menu_lock/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/menu_lock/static/description/assets/icons/pos-black.png differ diff --git a/menu_lock/static/description/assets/icons/puzzle.png b/menu_lock/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/menu_lock/static/description/assets/icons/puzzle.png differ diff --git a/menu_lock/static/description/assets/icons/restaurant-black.png b/menu_lock/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/menu_lock/static/description/assets/icons/restaurant-black.png differ diff --git a/menu_lock/static/description/assets/icons/service-black.png b/menu_lock/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/menu_lock/static/description/assets/icons/service-black.png differ diff --git a/menu_lock/static/description/assets/icons/trading-black.png b/menu_lock/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/menu_lock/static/description/assets/icons/trading-black.png differ diff --git a/menu_lock/static/description/assets/icons/training.png b/menu_lock/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/menu_lock/static/description/assets/icons/training.png differ diff --git a/menu_lock/static/description/assets/icons/update.png b/menu_lock/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/menu_lock/static/description/assets/icons/update.png differ diff --git a/menu_lock/static/description/assets/icons/user.png b/menu_lock/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/menu_lock/static/description/assets/icons/user.png differ diff --git a/menu_lock/static/description/assets/icons/wrench.png b/menu_lock/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/menu_lock/static/description/assets/icons/wrench.png differ diff --git a/menu_lock/static/description/assets/misc/categories.png b/menu_lock/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/menu_lock/static/description/assets/misc/categories.png differ diff --git a/menu_lock/static/description/assets/misc/check-box.png b/menu_lock/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/menu_lock/static/description/assets/misc/check-box.png differ diff --git a/menu_lock/static/description/assets/misc/compass.png b/menu_lock/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/menu_lock/static/description/assets/misc/compass.png differ diff --git a/menu_lock/static/description/assets/misc/corporate.png b/menu_lock/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/menu_lock/static/description/assets/misc/corporate.png differ diff --git a/menu_lock/static/description/assets/misc/customer-support.png b/menu_lock/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/menu_lock/static/description/assets/misc/customer-support.png differ diff --git a/menu_lock/static/description/assets/misc/cybrosys-logo.png b/menu_lock/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/menu_lock/static/description/assets/misc/cybrosys-logo.png differ diff --git a/menu_lock/static/description/assets/misc/features.png b/menu_lock/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/menu_lock/static/description/assets/misc/features.png differ diff --git a/menu_lock/static/description/assets/misc/logo.png b/menu_lock/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/menu_lock/static/description/assets/misc/logo.png differ diff --git a/menu_lock/static/description/assets/misc/pictures.png b/menu_lock/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/menu_lock/static/description/assets/misc/pictures.png differ diff --git a/menu_lock/static/description/assets/misc/pie-chart.png b/menu_lock/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/menu_lock/static/description/assets/misc/pie-chart.png differ diff --git a/menu_lock/static/description/assets/misc/right-arrow.png b/menu_lock/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/menu_lock/static/description/assets/misc/right-arrow.png differ diff --git a/menu_lock/static/description/assets/misc/star.png b/menu_lock/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/menu_lock/static/description/assets/misc/star.png differ diff --git a/menu_lock/static/description/assets/misc/support.png b/menu_lock/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/menu_lock/static/description/assets/misc/support.png differ diff --git a/menu_lock/static/description/assets/misc/whatsapp.png b/menu_lock/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/menu_lock/static/description/assets/misc/whatsapp.png differ diff --git a/menu_lock/static/description/assets/modules/2.png b/menu_lock/static/description/assets/modules/2.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/menu_lock/static/description/assets/modules/2.png differ diff --git a/menu_lock/static/description/assets/modules/3.png b/menu_lock/static/description/assets/modules/3.png new file mode 100644 index 000000000..6547c3081 Binary files /dev/null and b/menu_lock/static/description/assets/modules/3.png differ diff --git a/menu_lock/static/description/assets/modules/4.png b/menu_lock/static/description/assets/modules/4.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/menu_lock/static/description/assets/modules/4.png differ diff --git a/menu_lock/static/description/assets/modules/5.png b/menu_lock/static/description/assets/modules/5.png new file mode 100644 index 000000000..004c61a9e Binary files /dev/null and b/menu_lock/static/description/assets/modules/5.png differ diff --git a/menu_lock/static/description/assets/modules/6.png b/menu_lock/static/description/assets/modules/6.png new file mode 100644 index 000000000..0fbbac883 Binary files /dev/null and b/menu_lock/static/description/assets/modules/6.png differ diff --git a/menu_lock/static/description/assets/modules/img1.png b/menu_lock/static/description/assets/modules/img1.png new file mode 100644 index 000000000..bf10a4193 Binary files /dev/null and b/menu_lock/static/description/assets/modules/img1.png differ diff --git a/menu_lock/static/description/assets/screenshots/ML-001.png b/menu_lock/static/description/assets/screenshots/ML-001.png new file mode 100644 index 000000000..3b331250b Binary files /dev/null and b/menu_lock/static/description/assets/screenshots/ML-001.png differ diff --git a/menu_lock/static/description/assets/screenshots/ML-002.png b/menu_lock/static/description/assets/screenshots/ML-002.png new file mode 100644 index 000000000..05df9dee9 Binary files /dev/null and b/menu_lock/static/description/assets/screenshots/ML-002.png differ diff --git a/menu_lock/static/description/assets/screenshots/ML-003.png b/menu_lock/static/description/assets/screenshots/ML-003.png new file mode 100644 index 000000000..b4cc6d70b Binary files /dev/null and b/menu_lock/static/description/assets/screenshots/ML-003.png differ diff --git a/menu_lock/static/description/assets/screenshots/hero.gif b/menu_lock/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..c5c504bcc Binary files /dev/null and b/menu_lock/static/description/assets/screenshots/hero.gif differ diff --git a/menu_lock/static/description/banner.jpg b/menu_lock/static/description/banner.jpg new file mode 100644 index 000000000..56a3d231e Binary files /dev/null and b/menu_lock/static/description/banner.jpg differ diff --git a/menu_lock/static/description/icon.png b/menu_lock/static/description/icon.png new file mode 100644 index 000000000..c30dab236 Binary files /dev/null and b/menu_lock/static/description/icon.png differ diff --git a/menu_lock/static/description/index.html b/menu_lock/static/description/index.html new file mode 100755 index 000000000..2e1174079 --- /dev/null +++ b/menu_lock/static/description/index.html @@ -0,0 +1,579 @@ +
+ +
+ +
+
+ Community +
+
+
+ + +

Menu Lock in Odoo

+

This Is Used To Lock Menus And Provides Password To Unlock The Menus.

+ + +
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
This module helps to lock the menus, that is user can only enter into the module after login. + User can select the menus and lock them, both single password and multi password options are + provided ,if the user chooses single password option, then all ath menus selected will be unlocked + with same password. if user chooses multiple password option , then user can secure each menu with different + passwords. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community Support. +
+
+ + User can select the menus to lock. +
+
+ + Single and Multi password options. +
+
+ + Single Password Menu Lock. +
+
+ + Multiple Password Menu Lock. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

User can select the type of menu lock, single or multiple.

+

We can lock more menus with single password

+ +
+
+

+ Multiple Menus with different passwords

+

+ We can lock multiple menus with different passwords.

+ +
+
+

+ Menu Lock on choosing the lock enabled menus

+

+ On confirming if password matches it will open the menu otherwise shows error warning..

+ +
+
+
+ + + +
+
+

Related Modules

+

Explore our related modules

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

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/menu_lock/static/src/css/menu_lock.css b/menu_lock/static/src/css/menu_lock.css new file mode 100644 index 000000000..64762eeb6 --- /dev/null +++ b/menu_lock/static/src/css/menu_lock.css @@ -0,0 +1,26 @@ +.link-style{ + width: 400px; + height: 41px; + font-size: 17px; + border-color: black; + border-width: 1.5px; + margin-left: 100px; + margin-top: 4px; + } +.col-form-label { + padding-top: calc(0.375rem + 1px); + padding-bottom: calc(0.375rem + 1px); + margin-bottom: 0; + font-size: 20px; + line-height: 1.5; + color: black; +} +i.fa.fa-eye{ + padding-left:350px; + font-size:20px; +} +.toggle_eye{ + position: absolute; + right: 30px; + top: 10px; +} diff --git a/menu_lock/static/src/js/lock_action.js b/menu_lock/static/src/js/lock_action.js new file mode 100644 index 000000000..d3c7b7856 --- /dev/null +++ b/menu_lock/static/src/js/lock_action.js @@ -0,0 +1,78 @@ +/** @odoo-module **/ +import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { patch } from "@web/core/utils/patch"; +var core = require('web.core'); +var QWeb = core.qweb; +var Dialog = require('web.Dialog'); +var rpc = require('web.rpc'); +var _t = core._t; +patch(DropdownItem.prototype, "menu_lock", { + /** Click function of menu item **/ + async onClick(ev) { + var _super = this._super; + ev.preventDefault() + var session = require('web.session'); + var userId = session.uid; + var currentMenu = this.props.payload.id + /** Rpc query to get values about password lock from res.users **/ + await rpc.query({ + model: 'res.users', + method: 'menu_lock_search', + args: [ + [userId] + ], + }).then(function(data) { + /** Checking the current menu in menus to lock **/ + var menu = data.multi_lock_ids.filter(obj => { + return parseInt(obj.id) === parseInt(currentMenu) + }) + /** Check if current menu is lock menu **/ + if (menu.length != 0 && menu[0].id && menu[0].password) { + //Open dialog box to login + var dialog = new Dialog(this, { + title: "Menu Security PIN", + $content: $(QWeb.render('menuLockPopup', { + role: 'alert', + })), + size: 'medium', + buttons: [{ + text: _t("confirm"), + classes: 'btn-primary check_password', + click: false, + }, + { + text: _t("Cancel"), + close: true + }, + ], + }); + dialog.opened().then(() => { + /** show and hide the password on click of eye icon. **/ + dialog.$el.find('.toggle_eye').click(function(){ + var securityPin = dialog.$el.find('#password')[0]; + if (securityPin.type === "password") { + securityPin.type = "text"; + } else { + securityPin.type = "password"; + } + }) + /** dialog box confirm button function, if matches successfully logins to the menu, + otherwise show error warning. **/ + dialog.buttons[0].click = function(event) { + var current_pwd = dialog.$el.find('#password').val() + /** if password matches close the modal and enter into the model **/ + if (current_pwd == menu[0].password) { + dialog.close(); + _super(ev); + } else { + dialog.$el.find('#wrong_password_alert').show(); + } + }; + }); + dialog.open(); + } else { + _super(ev); + } + }) + }, +}); diff --git a/menu_lock/static/src/xml/menu_lock.xml b/menu_lock/static/src/xml/menu_lock.xml new file mode 100644 index 000000000..1eb3ed7b5 --- /dev/null +++ b/menu_lock/static/src/xml/menu_lock.xml @@ -0,0 +1,34 @@ + + + + + diff --git a/menu_lock/views/res_users_views.xml b/menu_lock/views/res_users_views.xml new file mode 100644 index 000000000..cd162e3a9 --- /dev/null +++ b/menu_lock/views/res_users_views.xml @@ -0,0 +1,33 @@ + + + + + res.users.view.form.inherit.menu.lock + res.users + + + + + + + + + + + + + + + + + + + + + + +