diff --git a/pos_face_recognition/README.rst b/pos_face_recognition/README.rst new file mode 100644 index 000000000..7b9ab899e --- /dev/null +++ b/pos_face_recognition/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Pos Face Recognition +======================= + This module helps you to login pos session by face recognition + +Configuration +============= +Opencv [version:4.2.0]and face recognition need to be installed[ +https://linuxize.com/post/how-to-install-opencv-on-ubuntu-20-04/] + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(http://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V16) Fathima Mazlin AM , 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/pos_face_recognition/__init__.py b/pos_face_recognition/__init__.py new file mode 100644 index 000000000..f74fca27d --- /dev/null +++ b/pos_face_recognition/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 LESSER GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +from . import models diff --git a/pos_face_recognition/__manifest__.py b/pos_face_recognition/__manifest__.py new file mode 100644 index 000000000..94e960589 --- /dev/null +++ b/pos_face_recognition/__manifest__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (odoo@cybrosys.com) +# +# +# This program is free software: you can modify +# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 LESSER GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +{ + 'name': 'Pos Face Recognition', + 'version': '16.0.1.0.0', + 'category': 'Point of Sales,Productivity', + 'summary': 'User can login pos session by face recognition method', + 'description': 'User can login pos session by face recognition ' + 'method.If any unauthorized login is detected a warning ' + 'message is arise.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'point_of_sale', 'hr'], + 'assets': { + 'point_of_sale.assets': [ + 'pos_face_recognition/static/src/js/pos_face_recognition.js', + ], + }, + 'external_dependencies': {'python': ['cv2', 'face_recognition']}, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/pos_face_recognition/doc/RELEASE_NOTES.md b/pos_face_recognition/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9e881a378 --- /dev/null +++ b/pos_face_recognition/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 31.10.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for Pos Face Recognition diff --git a/pos_face_recognition/models/__init__.py b/pos_face_recognition/models/__init__.py new file mode 100644 index 000000000..ca8123fa4 --- /dev/null +++ b/pos_face_recognition/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 LESSER GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +from . import hr_employee diff --git a/pos_face_recognition/models/hr_employee.py b/pos_face_recognition/models/hr_employee.py new file mode 100644 index 000000000..fc8737a0c --- /dev/null +++ b/pos_face_recognition/models/hr_employee.py @@ -0,0 +1,88 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Fathima Mazlin AM (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 LESSER GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +import base64 +import cv2 +import face_recognition +from io import BytesIO +import numpy as np +from PIL import Image +import time +from odoo import api, models + + +class HrEmployee(models.Model): + _inherit = 'hr.employee' + """For comparing image """ + + @api.model + def camera_open(self, kwargs): + """Capture the image from webcam and compare + with already saved image""" + cap = cv2.VideoCapture(0) # 0 is the index of the default camera + image = self.env['hr.employee'].browse(kwargs["id"]).image_1920 + binary_data = base64.b64decode(image) + image_bytes = BytesIO(binary_data) + pil_image = Image.open(image_bytes) + np_image = np.array(pil_image) + img_saved = cv2.cvtColor(np_image, cv2.COLOR_BGR2RGB) + encode_image_saved = face_recognition.face_encodings(img_saved) + face_recognized = 0 + start_time = time.time() + camera_time = 0 + login_now = 0 + while True: + ret, frame = cap.read() # Read a frame from the camera + cv2.imshow('frame', frame) # Display the frame + imgs = cv2.resize(frame, (0, 0), None, 0.25, 0.25) + imgs = cv2.cvtColor(imgs, cv2.COLOR_BGR2RGB) + face_current_frame = face_recognition.face_locations(imgs) + encode_current_frame = face_recognition.face_encodings( + imgs, + face_current_frame) + for encodeFace, faceLoc in zip(encode_current_frame, + face_current_frame): + matches1 = face_recognition.compare_faces(encode_image_saved, + encodeFace) + face_distance = face_recognition.face_distance( + encode_image_saved, + encodeFace) + match_index = np.argmin(face_distance) + elapsed_time = time.time() - start_time + if matches1[match_index]: + face_recognized = 1 + if elapsed_time > 6: + login_now = 1 + cap.release() + break + if login_now == 1: + break + if camera_time < 40 and login_now == 0: + camera_time = camera_time + 1 + else: + cap.release() + cv2.destroyAllWindows() + break + if cv2.waitKey(1) == ord('q'): + break + cap.release() # Release the camera + cv2.destroyAllWindows() # Close all windows + return face_recognized diff --git a/pos_face_recognition/static/description/assets/icons/check.png b/pos_face_recognition/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/check.png differ diff --git a/pos_face_recognition/static/description/assets/icons/chevron.png b/pos_face_recognition/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/chevron.png differ diff --git a/pos_face_recognition/static/description/assets/icons/cogs.png b/pos_face_recognition/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/cogs.png differ diff --git a/pos_face_recognition/static/description/assets/icons/consultation.png b/pos_face_recognition/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/consultation.png differ diff --git a/pos_face_recognition/static/description/assets/icons/ecom-black.png b/pos_face_recognition/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/ecom-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/education-black.png b/pos_face_recognition/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/education-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/hotel-black.png b/pos_face_recognition/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/hotel-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/license.png b/pos_face_recognition/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/license.png differ diff --git a/pos_face_recognition/static/description/assets/icons/lifebuoy.png b/pos_face_recognition/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_face_recognition/static/description/assets/icons/manufacturing-black.png b/pos_face_recognition/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/pos-black.png b/pos_face_recognition/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/pos-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/puzzle.png b/pos_face_recognition/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/puzzle.png differ diff --git a/pos_face_recognition/static/description/assets/icons/restaurant-black.png b/pos_face_recognition/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/service-black.png b/pos_face_recognition/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/service-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/trading-black.png b/pos_face_recognition/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/trading-black.png differ diff --git a/pos_face_recognition/static/description/assets/icons/training.png b/pos_face_recognition/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/training.png differ diff --git a/pos_face_recognition/static/description/assets/icons/update.png b/pos_face_recognition/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/update.png differ diff --git a/pos_face_recognition/static/description/assets/icons/user.png b/pos_face_recognition/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/user.png differ diff --git a/pos_face_recognition/static/description/assets/icons/wrench.png b/pos_face_recognition/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_face_recognition/static/description/assets/icons/wrench.png differ diff --git a/pos_face_recognition/static/description/assets/misc/categories.png b/pos_face_recognition/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/categories.png differ diff --git a/pos_face_recognition/static/description/assets/misc/check-box.png b/pos_face_recognition/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/check-box.png differ diff --git a/pos_face_recognition/static/description/assets/misc/compass.png b/pos_face_recognition/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/compass.png differ diff --git a/pos_face_recognition/static/description/assets/misc/corporate.png b/pos_face_recognition/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/corporate.png differ diff --git a/pos_face_recognition/static/description/assets/misc/customer-support.png b/pos_face_recognition/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/customer-support.png differ diff --git a/pos_face_recognition/static/description/assets/misc/cybrosys-logo.png b/pos_face_recognition/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/cybrosys-logo.png differ diff --git a/pos_face_recognition/static/description/assets/misc/features.png b/pos_face_recognition/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/features.png differ diff --git a/pos_face_recognition/static/description/assets/misc/logo.png b/pos_face_recognition/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/logo.png differ diff --git a/pos_face_recognition/static/description/assets/misc/pictures.png b/pos_face_recognition/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/pictures.png differ diff --git a/pos_face_recognition/static/description/assets/misc/pie-chart.png b/pos_face_recognition/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/pie-chart.png differ diff --git a/pos_face_recognition/static/description/assets/misc/right-arrow.png b/pos_face_recognition/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/right-arrow.png differ diff --git a/pos_face_recognition/static/description/assets/misc/star.png b/pos_face_recognition/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/star.png differ diff --git a/pos_face_recognition/static/description/assets/misc/support.png b/pos_face_recognition/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/support.png differ diff --git a/pos_face_recognition/static/description/assets/misc/whatsapp.png b/pos_face_recognition/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_face_recognition/static/description/assets/misc/whatsapp.png differ diff --git a/pos_face_recognition/static/description/assets/modules/custom_receipts_for_pos.png b/pos_face_recognition/static/description/assets/modules/custom_receipts_for_pos.png new file mode 100644 index 000000000..d1d3775d6 Binary files /dev/null and b/pos_face_recognition/static/description/assets/modules/custom_receipts_for_pos.png differ diff --git a/pos_face_recognition/static/description/assets/modules/login_pos_direct.png b/pos_face_recognition/static/description/assets/modules/login_pos_direct.png new file mode 100644 index 000000000..759574472 Binary files /dev/null and b/pos_face_recognition/static/description/assets/modules/login_pos_direct.png differ diff --git a/pos_face_recognition/static/description/assets/modules/point_of_sale_logo.png b/pos_face_recognition/static/description/assets/modules/point_of_sale_logo.png new file mode 100644 index 000000000..5ecc4d883 Binary files /dev/null and b/pos_face_recognition/static/description/assets/modules/point_of_sale_logo.png differ diff --git a/pos_face_recognition/static/description/assets/modules/pos_access_right_hr.png b/pos_face_recognition/static/description/assets/modules/pos_access_right_hr.png new file mode 100644 index 000000000..a586ef1bb Binary files /dev/null and b/pos_face_recognition/static/description/assets/modules/pos_access_right_hr.png differ diff --git a/pos_face_recognition/static/description/assets/modules/pos_book_order.jpg b/pos_face_recognition/static/description/assets/modules/pos_book_order.jpg new file mode 100644 index 000000000..d79685570 Binary files /dev/null and b/pos_face_recognition/static/description/assets/modules/pos_book_order.jpg differ diff --git a/pos_face_recognition/static/description/assets/modules/pos_receipt_extend.png b/pos_face_recognition/static/description/assets/modules/pos_receipt_extend.png new file mode 100755 index 000000000..a77027978 Binary files /dev/null and b/pos_face_recognition/static/description/assets/modules/pos_receipt_extend.png differ diff --git a/pos_face_recognition/static/description/assets/screenshots/capture.png b/pos_face_recognition/static/description/assets/screenshots/capture.png new file mode 100644 index 000000000..6c5af361c Binary files /dev/null and b/pos_face_recognition/static/description/assets/screenshots/capture.png differ diff --git a/pos_face_recognition/static/description/assets/screenshots/hero.gif b/pos_face_recognition/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..4988c93d3 Binary files /dev/null and b/pos_face_recognition/static/description/assets/screenshots/hero.gif differ diff --git a/pos_face_recognition/static/description/assets/screenshots/loginpage.png b/pos_face_recognition/static/description/assets/screenshots/loginpage.png new file mode 100644 index 000000000..939c9f96f Binary files /dev/null and b/pos_face_recognition/static/description/assets/screenshots/loginpage.png differ diff --git a/pos_face_recognition/static/description/assets/screenshots/select_cashier.png b/pos_face_recognition/static/description/assets/screenshots/select_cashier.png new file mode 100644 index 000000000..306a07594 Binary files /dev/null and b/pos_face_recognition/static/description/assets/screenshots/select_cashier.png differ diff --git a/pos_face_recognition/static/description/assets/screenshots/unauthorized.png b/pos_face_recognition/static/description/assets/screenshots/unauthorized.png new file mode 100644 index 000000000..862c1155a Binary files /dev/null and b/pos_face_recognition/static/description/assets/screenshots/unauthorized.png differ diff --git a/pos_face_recognition/static/description/banner.png b/pos_face_recognition/static/description/banner.png new file mode 100644 index 000000000..8e156f102 Binary files /dev/null and b/pos_face_recognition/static/description/banner.png differ diff --git a/pos_face_recognition/static/description/icon.png b/pos_face_recognition/static/description/icon.png new file mode 100644 index 000000000..3fd83d705 Binary files /dev/null and b/pos_face_recognition/static/description/icon.png differ diff --git a/pos_face_recognition/static/description/index.html b/pos_face_recognition/static/description/index.html new file mode 100644 index 000000000..df8a21256 --- /dev/null +++ b/pos_face_recognition/static/description/index.html @@ -0,0 +1,674 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +

+ Pos Face Recognition

+

+ POS Session Login by Face Recognition

+ + + +
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module helps you to login pos session by face recognition. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community Support. +
+
+ + Login by using face recognition. +
+
+ + +
+
+
+

+ Configuration +

+
+
+
+

Opencv [version:4.2.0] and face recognition need to be installed.

+

Following steps required to install Opencv in Ubuntu 20.04:

+

1. $ sudo apt update

+

2. $ sudo apt install libopencv-dev python3-opencv

+

Verify the installation by importing the cv2 module and printing the OpenCV version:

+

python3 -c "import cv2; print(cv2.__version__)"

+

Following steps required to install face recognition in Ubuntu 20.04:

+

1. $ pip install face_recognition

+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Select Cashier

+ +
+
+

+ Face Recognition

+

+ A camera will open after choosing a cashier on the POS + session login screen, and compare the webcam images with + already saved images. + Log in to the POS session if these two images are the same; + otherwise, an error message is generated.

+ +
+
+

+ Successfully Login.

+ +
+ +
+

+ Unauthorized Access.

+

+ If mismatch the webcam image with already saved image an + error message is generated.

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

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need + help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+
+ \ No newline at end of file diff --git a/pos_face_recognition/static/src/js/pos_face_recognition.js b/pos_face_recognition/static/src/js/pos_face_recognition.js new file mode 100644 index 000000000..3012ab7c6 --- /dev/null +++ b/pos_face_recognition/static/src/js/pos_face_recognition.js @@ -0,0 +1,64 @@ +odoo.define('pos_face_recognition.pos_face_recognition', function (require) { + 'use strict'; + const LoginScreen = require('pos_hr.LoginScreen'); + const Registries = require('point_of_sale.Registries'); + const SelectCashierMixin = require('pos_hr.SelectCashierMixin'); + const rpc = require('web.rpc'); + const FaceRecognition = (LoginScreen) => + class extends LoginScreen { + /** + For camera open + **/ + async cameraOpen(employee) { + var self= this + await rpc.query({ + model:'hr.employee', + method:'camera_open', + args: [employee] + }).then( function(data){ + if (data == 1) { + self.env.pos.set_cashier(employee); + self.props.resolve({ confirmed: true, payload: true }); + self.trigger('close-temp-screen'); + } else { + self.showPopup('ErrorPopup',{ + 'title': "Unauthorized Access detected", + 'body': "Face Recognition Failed", + }); + return; + } + }); + } + /** + For selecting the cashier + **/ + async selectCashier() { + if (this.env.pos.config.module_pos_hr) { + const employeesList = this.env.pos.employees + .filter((employee) => employee.id !== + this.env.pos.get_cashier().id).map((employee) => { + return { + id: employee.id, + item: employee, + label: employee.name, + isSelected: false, + }; + }); + let {confirmed, payload: employee} = + await this.showPopup('SelectionPopup', { + title: this.env._t('Change Cashier'), + list: employeesList, + }); + if (!confirmed) { + return; + } + if (employee) { + employee = await this.cameraOpen(employee); + } + return employee; + } + } + } + Registries.Component.extend(LoginScreen, FaceRecognition); + return FaceRecognition; +});