diff --git a/login_using_qr/README.rst b/login_using_qr/README.rst new file mode 100755 index 000000000..cdc9cdd5a --- /dev/null +++ b/login_using_qr/README.rst @@ -0,0 +1,52 @@ +.. 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, + (V18) Mufeeda Shirin, +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..db103e820 --- /dev/null +++ b/login_using_qr/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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..dc83f06e6 --- /dev/null +++ b/login_using_qr/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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': '18.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..8607481f0 --- /dev/null +++ b/login_using_qr/authenticate.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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..d0b970387 --- /dev/null +++ b/login_using_qr/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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..c932ba8e5 --- /dev/null +++ b/login_using_qr/controllers/login_using_qr.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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..0a5e0c27d --- /dev/null +++ b/login_using_qr/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 02.07.2025 +#### Version 18.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..32f6931b6 --- /dev/null +++ b/login_using_qr/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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..9cf79a441 --- /dev/null +++ b/login_using_qr/models/res_users.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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/Icon.png b/login_using_qr/static/description/Icon.png new file mode 100644 index 000000000..e06039e18 Binary files /dev/null and b/login_using_qr/static/description/Icon.png differ diff --git a/login_using_qr/static/description/assets/cybro-icon.png b/login_using_qr/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/login_using_qr/static/description/assets/cybro-icon.png differ diff --git a/login_using_qr/static/description/assets/cybro-odoo.png b/login_using_qr/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/login_using_qr/static/description/assets/cybro-odoo.png differ diff --git a/login_using_qr/static/description/assets/h2.png b/login_using_qr/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/login_using_qr/static/description/assets/h2.png differ diff --git a/login_using_qr/static/description/assets/icons/arrows-repeat.svg b/login_using_qr/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/banner-1.png b/login_using_qr/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/banner-1.png differ diff --git a/login_using_qr/static/description/assets/icons/banner-2.svg b/login_using_qr/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/banner-bg.png b/login_using_qr/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/banner-bg.png differ diff --git a/login_using_qr/static/description/assets/icons/banner-bg.svg b/login_using_qr/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/login_using_qr/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/banner-call.svg b/login_using_qr/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/login_using_qr/static/description/assets/icons/banner-mail.svg b/login_using_qr/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/login_using_qr/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/login_using_qr/static/description/assets/icons/banner-pattern.svg b/login_using_qr/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/banner-promo.svg b/login_using_qr/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/blog-icon.png b/login_using_qr/static/description/assets/icons/blog-icon.png new file mode 100644 index 000000000..ba4c7c366 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/blog-icon.png differ diff --git a/login_using_qr/static/description/assets/icons/brand-pair.svg b/login_using_qr/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/login_using_qr/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/close-icon.svg b/login_using_qr/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/login_using_qr/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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/collabarate-icon.svg b/login_using_qr/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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/copylink.svg b/login_using_qr/static/description/assets/icons/copylink.svg new file mode 100644 index 000000000..3b67f60e0 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/copylink.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/cybro-logo.png b/login_using_qr/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/cybro-logo.png differ diff --git a/login_using_qr/static/description/assets/icons/down.svg b/login_using_qr/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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/faq.png b/login_using_qr/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/faq.png differ diff --git a/login_using_qr/static/description/assets/icons/feature-icon.svg b/login_using_qr/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/feature.png b/login_using_qr/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/feature.png differ diff --git a/login_using_qr/static/description/assets/icons/gear.svg b/login_using_qr/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/login_using_qr/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/hero.gif b/login_using_qr/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/login_using_qr/static/description/assets/icons/hero.gif differ diff --git a/login_using_qr/static/description/assets/icons/hire-odoo.svg b/login_using_qr/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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/life-ring-icon.svg b/login_using_qr/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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/logo.png b/login_using_qr/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/login_using_qr/static/description/assets/icons/logo.png differ diff --git a/login_using_qr/static/description/assets/icons/mail.svg b/login_using_qr/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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/notes.png b/login_using_qr/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/notes.png differ diff --git a/login_using_qr/static/description/assets/icons/notification icon.svg b/login_using_qr/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/odoo-consultancy.svg b/login_using_qr/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/login_using_qr/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/login_using_qr/static/description/assets/icons/odoo-licencing.svg b/login_using_qr/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/login_using_qr/static/description/assets/icons/odoo-logo.png b/login_using_qr/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/login_using_qr/static/description/assets/icons/odoo-logo.png differ diff --git a/login_using_qr/static/description/assets/icons/patter.svg b/login_using_qr/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/login_using_qr/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/pattern1.png b/login_using_qr/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/login_using_qr/static/description/assets/icons/pattern1.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-piece-icon.svg b/login_using_qr/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/replace-icon.svg b/login_using_qr/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/screenshot-main.png b/login_using_qr/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/screenshot-main.png differ diff --git a/login_using_qr/static/description/assets/icons/screenshot.png b/login_using_qr/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/screenshot.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/skype-fill.svg b/login_using_qr/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/skype.png b/login_using_qr/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/skype.png differ diff --git a/login_using_qr/static/description/assets/icons/skype.svg b/login_using_qr/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/login_using_qr/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/login_using_qr/static/description/assets/icons/star-1.svg b/login_using_qr/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/star-2.svg b/login_using_qr/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/login_using_qr/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/login_using_qr/static/description/assets/icons/support.png b/login_using_qr/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/support.png differ diff --git a/login_using_qr/static/description/assets/icons/test-1 - Copy.png b/login_using_qr/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/test-1 - Copy.png differ diff --git a/login_using_qr/static/description/assets/icons/test-1.png b/login_using_qr/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/login_using_qr/static/description/assets/icons/test-1.png differ diff --git a/login_using_qr/static/description/assets/icons/test-2.png b/login_using_qr/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/login_using_qr/static/description/assets/icons/test-2.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/translate.svg b/login_using_qr/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/login_using_qr/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/video.png b/login_using_qr/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/video.png differ diff --git a/login_using_qr/static/description/assets/icons/whatsapp.png b/login_using_qr/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/login_using_qr/static/description/assets/icons/whatsapp.png differ diff --git a/login_using_qr/static/description/assets/icons/whatsapp.svg b/login_using_qr/static/description/assets/icons/whatsapp.svg new file mode 100644 index 000000000..bba9ca395 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/whatsapp.svg @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/login_using_qr/static/description/assets/icons/wrench-icon.svg b/login_using_qr/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/login_using_qr/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/icons/youtube-icon.png b/login_using_qr/static/description/assets/icons/youtube-icon.png new file mode 100644 index 000000000..f206560dc Binary files /dev/null and b/login_using_qr/static/description/assets/icons/youtube-icon.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.png b/login_using_qr/static/description/assets/modules/1.png new file mode 100644 index 000000000..e0b09a5a0 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/1.png differ diff --git a/login_using_qr/static/description/assets/modules/2.png b/login_using_qr/static/description/assets/modules/2.png new file mode 100644 index 000000000..ecea68d98 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/2.png differ diff --git a/login_using_qr/static/description/assets/modules/3.jpg b/login_using_qr/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..a83c58aac Binary files /dev/null and b/login_using_qr/static/description/assets/modules/3.jpg differ diff --git a/login_using_qr/static/description/assets/modules/4.jpg b/login_using_qr/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..31a56b08c Binary files /dev/null and b/login_using_qr/static/description/assets/modules/4.jpg 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..3b40aa4e4 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..5d071f8ae 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/modules/budget_image.png b/login_using_qr/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..b50130c7d Binary files /dev/null and b/login_using_qr/static/description/assets/modules/budget_image.png differ diff --git a/login_using_qr/static/description/assets/modules/credit_image.png b/login_using_qr/static/description/assets/modules/credit_image.png new file mode 100644 index 000000000..3ad04ecfd Binary files /dev/null and b/login_using_qr/static/description/assets/modules/credit_image.png differ diff --git a/login_using_qr/static/description/assets/modules/employee_image.png b/login_using_qr/static/description/assets/modules/employee_image.png new file mode 100644 index 000000000..30ad58232 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/employee_image.png differ diff --git a/login_using_qr/static/description/assets/modules/export_image.png b/login_using_qr/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/login_using_qr/static/description/assets/modules/export_image.png differ diff --git a/login_using_qr/static/description/assets/modules/gantt_image.png b/login_using_qr/static/description/assets/modules/gantt_image.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/login_using_qr/static/description/assets/modules/gantt_image.png differ diff --git a/login_using_qr/static/description/assets/modules/quotation_image.png b/login_using_qr/static/description/assets/modules/quotation_image.png new file mode 100644 index 000000000..499b1a72f Binary files /dev/null and b/login_using_qr/static/description/assets/modules/quotation_image.png differ diff --git a/login_using_qr/static/description/assets/screenshots/1.png b/login_using_qr/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..2fab6d3a4 Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/1.png differ diff --git a/login_using_qr/static/description/assets/screenshots/2.png b/login_using_qr/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..5bf259cc4 Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/2.png differ diff --git a/login_using_qr/static/description/assets/screenshots/5.png b/login_using_qr/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..161fe6ec0 Binary files /dev/null and b/login_using_qr/static/description/assets/screenshots/5.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/y18.jpg b/login_using_qr/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/login_using_qr/static/description/assets/y18.jpg 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..1b7bc6c38 Binary files /dev/null and b/login_using_qr/static/description/banner.jpg differ diff --git a/login_using_qr/static/description/hero.gif b/login_using_qr/static/description/hero.gif new file mode 100644 index 000000000..926f74416 Binary files /dev/null and b/login_using_qr/static/description/hero.gif 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..923497caf --- /dev/null +++ b/login_using_qr/static/description/index.html @@ -0,0 +1,1065 @@ + + + + + + Login using QR Code + + + + + + + + + + +
+
+ + + +
+
+
+
+
+
+ +
+ Supports: +
+ Community +
+
+ Enterprise +
+
+
+
+
+ Availability: +
+ On Premise +
+
+ Odoo.sh +
+
+ Odoo Online +
+
+
+
+
+
+
+ +
+
+
+
+

+ Users can Log in by Scanning QR Code +

+

Login using QR Code +

+
+
+ +
+ + + + + +
+ +
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ Login using QR Code +

+ Are you ready to make your business more + organized? +
Improve now! +

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

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 +

+
+
+
+
+ + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Login + QR Code +

+
+
+

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

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

+ Login With + + QR Option +

+
+
+

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

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

+ Opens Camera + +

+
+
+

+ +

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

+ Scan QR Code + +

+
+
+

+ Show the QR code here +

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

+ User Logged In + +

+
+
+

+ User Logged in to their account after scanning the QR. +

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

+ Login by Scanning QR Code.

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

+ Each user has a unique QR code available on their user form. + To log in, simply scan this QR code using the QR scanner on + the login screen, and the system will authenticate the user automatically. +

+
+
+ +
+ +
+

+ You can find the QR code on the user’s form + under the QR Code section. This code can be printed + or downloaded for convenient future logins. +

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

+ Latest Release 18.0.1.0.0 +

+ + 2nd July, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+ +
+
+
+ + + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+ + + + + + + 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..d5edc7887 --- /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; + } +} 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..fc4ca9487 --- /dev/null +++ b/login_using_qr/static/src/js/login.js @@ -0,0 +1,55 @@ +/** @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 { rpc } from "@web/core/network/rpc"; + +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'); + 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) { + rpc('/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..86a6664ae --- /dev/null +++ b/login_using_qr/views/login_templates.xml @@ -0,0 +1,23 @@ + + + + + + + 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
+ +
+
+
+
+