diff --git a/login_using_qr/README.rst b/login_using_qr/README.rst new file mode 100755 index 000000000..cfd0c13fc --- /dev/null +++ b/login_using_qr/README.rst @@ -0,0 +1,51 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Login using Qr code +============= +Internal users can login by scanning QR Code. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + + +Credits +------- +Developer: + (V15) Mohamed Muzammil VP, + (v16) muzammil, + (v17) Anjhana A K, +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/login_using_qr/__init__.py b/login_using_qr/__init__.py new file mode 100644 index 000000000..e971ac81b --- /dev/null +++ b/login_using_qr/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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 authenticate +from . import controllers +from . import models diff --git a/login_using_qr/__manifest__.py b/login_using_qr/__manifest__.py new file mode 100644 index 000000000..a338a949b --- /dev/null +++ b/login_using_qr/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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': 'Login using QR Code', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Users can login by scanning QR Code', + 'description': 'A QR code is generate corresponding to each internal user' + ' and,they can use this QR code to login to their account by' + ' scanning it', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'data': [ + 'views/login_templates.xml', + 'views/res_users_views.xml', + 'views/login_using_qr_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'login_using_qr/static/src/js/login.js', + 'login_using_qr/static/src/css/login_with_qr.css', + 'https://cdn.rawgit.com/cozmo/jsQR/master/dist/jsQR.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/login_using_qr/authenticate.py b/login_using_qr/authenticate.py new file mode 100644 index 000000000..c61e3bcf5 --- /dev/null +++ b/login_using_qr/authenticate.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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 . +# +############################################################################### + +import odoo +from odoo.http import request +from odoo.modules.registry import Registry +from odoo.http import Session + + +def authenticate_without_passwd(self, dbname, login): + """This function creates a authentication methode without password""" + registry = Registry(dbname) + pre_uid = request.env['res.users'].sudo().search([('login', '=', login)]).id + self.uid = None + self.pre_login = login + self.pre_uid = pre_uid + with registry.cursor() as cr: + env = odoo.api.Environment(cr, pre_uid, {}) + user = env['res.users'].browse(pre_uid) + if not user._mfa_url(): + self.finalize(env) + if request and request.session is self and request.db == dbname: + request.env = odoo.api.Environment(request.env.cr, self.uid, + self.context) + request.update_context(**self.context) + return pre_uid +Session.authenticate_without_passwd = authenticate_without_passwd diff --git a/login_using_qr/controllers/__init__.py b/login_using_qr/controllers/__init__.py new file mode 100644 index 000000000..3f734b9db --- /dev/null +++ b/login_using_qr/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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 login_using_qr diff --git a/login_using_qr/controllers/login_using_qr.py b/login_using_qr/controllers/login_using_qr.py new file mode 100644 index 000000000..c92ff678f --- /dev/null +++ b/login_using_qr/controllers/login_using_qr.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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 http +from odoo.http import Controller, request + + +class LoginController(Controller): + """Controller that works when Login With QR clicked""" + + @http.route(['/web/redirect'], type='json', auth='none', website=True, + csrf=False, csrf_token=None) + def scanner(self, scanned_qr): + """This code scans the QR provided and Login to the corresponding user + note: Only Internal User can log in through it""" + users = request.env['res.users'].sudo().search([('share', '=', False)]) + login = users.mapped('login') + if scanned_qr in login: + request.session.authenticate_without_passwd( + request.session.db, scanned_qr) + return request.redirect('/') + else: + return False diff --git a/login_using_qr/doc/RELEASE_NOTES.md b/login_using_qr/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..edec9daee --- /dev/null +++ b/login_using_qr/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 13.02.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Login using Qr code diff --git a/login_using_qr/models/__init__.py b/login_using_qr/models/__init__.py new file mode 100644 index 000000000..a1a49056a --- /dev/null +++ b/login_using_qr/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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 res_users diff --git a/login_using_qr/models/res_users.py b/login_using_qr/models/res_users.py new file mode 100644 index 000000000..8949cda77 --- /dev/null +++ b/login_using_qr/models/res_users.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Anjhana A K (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 . +# +############################################################################### +try: + import qrcode +except ImportError: + qrcode = None +try: + import base64 +except ImportError: + base64 = None +from io import BytesIO +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class ResUsers(models.Model): + """ Inherit the model to add a field and methods""" + _inherit = "res.users" + + qr_code = fields.Binary(string='QRcode', compute="_compute_qr_code", + help="Use this to login (only for internal users)") + + def _compute_qr_code(self): + """Method to generate QR code""" + for detail in self: + if qrcode and base64: + qr_code = qrcode.QRCode( + version=1, + error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=3, + border=4,) + qr_code.add_data(detail.login) + qr_code.make(fit=True) + temp = BytesIO() + qr_code.make_image().save(temp, format="PNG") + detail.update({'qr_code': base64.b64encode(temp.getvalue())}) + else: + raise UserError( + _('Necessary Requirements To Run This Operation Is ' + 'Not Satisfied')) diff --git a/login_using_qr/static/description/assets/icons/check.png b/login_using_qr/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/login_using_qr/static/description/assets/icons/check.png differ diff --git a/login_using_qr/static/description/assets/icons/chevron.png b/login_using_qr/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/chevron.png differ diff --git a/login_using_qr/static/description/assets/icons/cogs.png b/login_using_qr/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/cogs.png differ diff --git a/login_using_qr/static/description/assets/icons/consultation.png b/login_using_qr/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/login_using_qr/static/description/assets/icons/consultation.png differ diff --git a/login_using_qr/static/description/assets/icons/ecom-black.png b/login_using_qr/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/ecom-black.png differ diff --git a/login_using_qr/static/description/assets/icons/education-black.png b/login_using_qr/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/login_using_qr/static/description/assets/icons/education-black.png differ diff --git a/login_using_qr/static/description/assets/icons/hotel-black.png b/login_using_qr/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/login_using_qr/static/description/assets/icons/hotel-black.png differ diff --git a/login_using_qr/static/description/assets/icons/license.png b/login_using_qr/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/login_using_qr/static/description/assets/icons/license.png differ diff --git a/login_using_qr/static/description/assets/icons/lifebuoy.png b/login_using_qr/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/login_using_qr/static/description/assets/icons/lifebuoy.png differ diff --git a/login_using_qr/static/description/assets/icons/manufacturing-black.png b/login_using_qr/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/login_using_qr/static/description/assets/icons/manufacturing-black.png differ diff --git a/login_using_qr/static/description/assets/icons/pos-black.png b/login_using_qr/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/pos-black.png differ diff --git a/login_using_qr/static/description/assets/icons/puzzle.png b/login_using_qr/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/puzzle.png differ diff --git a/login_using_qr/static/description/assets/icons/restaurant-black.png b/login_using_qr/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/restaurant-black.png differ diff --git a/login_using_qr/static/description/assets/icons/service-black.png b/login_using_qr/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/login_using_qr/static/description/assets/icons/service-black.png differ diff --git a/login_using_qr/static/description/assets/icons/trading-black.png b/login_using_qr/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/trading-black.png differ diff --git a/login_using_qr/static/description/assets/icons/training.png b/login_using_qr/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/login_using_qr/static/description/assets/icons/training.png differ diff --git a/login_using_qr/static/description/assets/icons/update.png b/login_using_qr/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/login_using_qr/static/description/assets/icons/update.png differ diff --git a/login_using_qr/static/description/assets/icons/user.png b/login_using_qr/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/login_using_qr/static/description/assets/icons/user.png differ diff --git a/login_using_qr/static/description/assets/icons/wrench.png b/login_using_qr/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/login_using_qr/static/description/assets/icons/wrench.png differ diff --git a/login_using_qr/static/description/assets/misc/Cybrosys R.png b/login_using_qr/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/Cybrosys R.png differ diff --git a/login_using_qr/static/description/assets/misc/categories.png b/login_using_qr/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/categories.png differ diff --git a/login_using_qr/static/description/assets/misc/check-box.png b/login_using_qr/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/check-box.png differ diff --git a/login_using_qr/static/description/assets/misc/compass.png b/login_using_qr/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/login_using_qr/static/description/assets/misc/compass.png differ diff --git a/login_using_qr/static/description/assets/misc/corporate.png b/login_using_qr/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/login_using_qr/static/description/assets/misc/corporate.png differ diff --git a/login_using_qr/static/description/assets/misc/customer-support.png b/login_using_qr/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/login_using_qr/static/description/assets/misc/customer-support.png differ diff --git a/login_using_qr/static/description/assets/misc/cybrosys-logo.png b/login_using_qr/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/login_using_qr/static/description/assets/misc/cybrosys-logo.png differ diff --git a/login_using_qr/static/description/assets/misc/features.png b/login_using_qr/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/features.png differ diff --git a/login_using_qr/static/description/assets/misc/logo.png b/login_using_qr/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/login_using_qr/static/description/assets/misc/logo.png differ diff --git a/login_using_qr/static/description/assets/misc/pictures.png b/login_using_qr/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/pictures.png differ diff --git a/login_using_qr/static/description/assets/misc/pie-chart.png b/login_using_qr/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/pie-chart.png differ diff --git a/login_using_qr/static/description/assets/misc/right-arrow.png b/login_using_qr/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/right-arrow.png differ diff --git a/login_using_qr/static/description/assets/misc/star.png b/login_using_qr/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/login_using_qr/static/description/assets/misc/star.png differ diff --git a/login_using_qr/static/description/assets/misc/support.png b/login_using_qr/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/support.png differ diff --git a/login_using_qr/static/description/assets/misc/whatsapp.png b/login_using_qr/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/login_using_qr/static/description/assets/misc/whatsapp.png differ diff --git a/login_using_qr/static/description/assets/modules/1.jpg b/login_using_qr/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/1.jpg differ diff --git a/login_using_qr/static/description/assets/modules/2.jpg b/login_using_qr/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..87c2bb2ba Binary files /dev/null and b/login_using_qr/static/description/assets/modules/2.jpg differ diff --git a/login_using_qr/static/description/assets/modules/3.png b/login_using_qr/static/description/assets/modules/3.png new file mode 100644 index 000000000..a5299d338 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/3.png differ diff --git a/login_using_qr/static/description/assets/modules/4.png b/login_using_qr/static/description/assets/modules/4.png new file mode 100644 index 000000000..a0ac2d840 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/4.png differ diff --git a/login_using_qr/static/description/assets/modules/5.jpg b/login_using_qr/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..6a102f103 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/5.jpg differ diff --git a/login_using_qr/static/description/assets/modules/6.jpg b/login_using_qr/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..eaf13fef5 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/6.jpg differ diff --git a/login_using_qr/static/description/assets/screenshots/hero.gif b/login_using_qr/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6f80d8e2d Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/hero.gif differ diff --git a/login_using_qr/static/description/assets/screenshots/screenshot1.png b/login_using_qr/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..2d30b3bde Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/screenshot1.png differ diff --git a/login_using_qr/static/description/assets/screenshots/screenshot2.png b/login_using_qr/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..2d4a94242 Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/screenshot2.png differ diff --git a/login_using_qr/static/description/assets/screenshots/screenshot3.png b/login_using_qr/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..a532bc57b Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/screenshot3.png differ diff --git a/login_using_qr/static/description/assets/screenshots/screenshot4.png b/login_using_qr/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..10605e9a1 Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/screenshot4.png differ diff --git a/login_using_qr/static/description/assets/screenshots/screenshot5.png b/login_using_qr/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..f24914d4a Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/screenshot5.png differ diff --git a/login_using_qr/static/description/banner.jpg b/login_using_qr/static/description/banner.jpg new file mode 100644 index 000000000..e87fd121b Binary files /dev/null and b/login_using_qr/static/description/banner.jpg differ diff --git a/login_using_qr/static/description/icon.png b/login_using_qr/static/description/icon.png new file mode 100644 index 000000000..d486dc7a8 Binary files /dev/null and b/login_using_qr/static/description/icon.png differ diff --git a/login_using_qr/static/description/index.html b/login_using_qr/static/description/index.html new file mode 100644 index 000000000..35d2620e8 --- /dev/null +++ b/login_using_qr/static/description/index.html @@ -0,0 +1,698 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Login using Qr code

+

+ Users can Log in by Scanning QR Code +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ User Qr code Generation

+

This module generate login qr code to users. +

+
+
+
+
+
+
+ +
+
+

+ Login using qrcode

+

Using each users qr code they can easily login +

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

+ Go to Settings ->Users & Companies, Inside the Users QR is generated

+
+
+
+
+
+
+ + +
+
+

+ Click ->"Login With QR" and a camera will be open, scan the QR code there

+
+
+
+
+
+
+ +
+
+

Opens camera.

+
+
+
+
+
+
+ +
+
+

Show the QR code here

+
+
+
+
+
+
+ +
+
+

User Logged in to their account after scanning the QR.

+
+
+
+
+ +
+
+
    +
  • + Support in Desktop. +
  • +
  • + Login by Scanning QR Code +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:08th Feburary 2024 +
+

+ + Initial Commit for Login using qr code.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/login_using_qr/static/src/css/login_with_qr.css b/login_using_qr/static/src/css/login_with_qr.css new file mode 100644 index 000000000..a5a096fc1 --- /dev/null +++ b/login_using_qr/static/src/css/login_with_qr.css @@ -0,0 +1,34 @@ +.clearfix.oe_login_buttons.text-center.mb-1.pt-3{ + position:relative; +} + +.qr_video { + position: absolute; + top: -353px; + left: -269px; +} + +.video-container{ +width:717px; +} + +.video-container video{ +width:100% !important; +height:100% !important; +} + +.o_database_list .input-group-prepend .btn, .input-group-append a{ + z-index:0 !important; +} + +@media (max-width: 767.98px) { +.qr_video{ + position: absolute; + top: -281px; + min-width: 200px; + left: -63px; +} +.video-container { +width:360px; + +}} \ No newline at end of file diff --git a/login_using_qr/static/src/js/login.js b/login_using_qr/static/src/js/login.js new file mode 100644 index 000000000..689da933a --- /dev/null +++ b/login_using_qr/static/src/js/login.js @@ -0,0 +1,56 @@ +/** @odoo-module */ +import publicWidget from "@web/legacy/js/public/public_widget"; +import {login} from "@web/legacy/js/public/signin"; +import { _t } from "@web/core/l10n/translation"; +import { jsonrpc } from "@web/core/network/rpc_service"; + + publicWidget.registry.login.include({ + events: Object.assign({}, publicWidget.Widget.prototype.events, { + 'click #login_click': '_onLoginClick', + 'click #close_qr_scanner':'_onClickClose' + }), + _onClickClose(ev) { + window.location.reload(); + }, + async _onLoginClick(ev) { + ev.target.offsetParent.querySelector('.close_button').classList.remove('d-none'); + const video = ev.target.offsetParent.querySelector('#video'); + console.log('ed',navigator.mediaDevices) + var cam_stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false }); + video.srcObject = cam_stream; + video.addEventListener('loadedmetadata', (event) => { + // Adjust video size once metadata is loaded + video.width = video.videoWidth; + video.height = video.videoHeight; + }); + video.addEventListener('canplay', () => { + const canvas = document.createElement('canvas'); + const context = canvas.getContext('2d'); + canvas.width = video.width; + canvas.height = video.height; + setInterval(() => { + context.drawImage(video, 0, 0, canvas.width, canvas.height); + const imageData = context.getImageData(0, 0, canvas.width, canvas.height); + const code = jsQR(imageData.data, imageData.width, imageData.height); + if (code) { + jsonrpc('/web/redirect',{ + 'scanned_qr': code.data} + ).then((token) => { + if(token){ + cam_stream.getTracks().forEach(function(track) { + track.stop(); + window.location.href = '/'; + }); + } + else{ + alert('Scanned QR does not exist. Please try again.'); + window.location.reload(); + } + }); + } + }, 1000); // Adjust the interval as needed + }); + } + + }) + diff --git a/login_using_qr/views/login_templates.xml b/login_using_qr/views/login_templates.xml new file mode 100644 index 000000000..f53d494eb --- /dev/null +++ b/login_using_qr/views/login_templates.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/login_using_qr/views/login_using_qr_templates.xml b/login_using_qr/views/login_using_qr_templates.xml new file mode 100644 index 000000000..a09258df6 --- /dev/null +++ b/login_using_qr/views/login_using_qr_templates.xml @@ -0,0 +1,33 @@ + + + + + + + diff --git a/login_using_qr/views/res_users_views.xml b/login_using_qr/views/res_users_views.xml new file mode 100644 index 000000000..deb546c6e --- /dev/null +++ b/login_using_qr/views/res_users_views.xml @@ -0,0 +1,17 @@ + + + + + res.users.view.form.inherit.login.using.qr + res.users + + + + + LOGIN QR
+ +
+
+
+
+