diff --git a/image_capture_upload_widget/README.rst b/image_capture_upload_widget/README.rst new file mode 100644 index 000000000..f14fac20d --- /dev/null +++ b/image_capture_upload_widget/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/licenses-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Image Capture Widget +======================= +This module allow to Capture images from the webcam . + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Gnu Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: + (V16) Megha K , + (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/image_capture_upload_widget/__init__.py b/image_capture_upload_widget/__init__.py new file mode 100644 index 000000000..ca5e40d9c --- /dev/null +++ b/image_capture_upload_widget/__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 wizard diff --git a/image_capture_upload_widget/__manifest__.py b/image_capture_upload_widget/__manifest__.py new file mode 100644 index 000000000..4f9217cec --- /dev/null +++ b/image_capture_upload_widget/__manifest__.py @@ -0,0 +1,53 @@ +# -*- 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': 'Image Capture Widget', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'sequence': '20', + 'summary': 'Image Capture Widget for Image Field. ' + 'This module allows to capture the users image from the webcam.', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'description': "This module is used to add Image Capture Widget for Image " + "Field. We can capture the image from the webcam and " + "upload into the binary field", + 'depends': ['sale_management', 'contacts'], + 'images': ['static/description/banner.jpg'], + 'data': [ + 'security/ir.model.access.csv', + ], + 'assets': { + 'web.assets_backend': [ + '/image_capture_upload_widget/static/src/scss/image_capture.scss', + '/image_capture_upload_widget/static/src/js/image_capture.js', + '/image_capture_upload_widget/static/src/xml/image_capture_templates.xml', + ], + }, + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/image_capture_upload_widget/doc/RELEASE_NOTES.md b/image_capture_upload_widget/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b80abd5e0 --- /dev/null +++ b/image_capture_upload_widget/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 30.01.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Image Capture Widget + diff --git a/image_capture_upload_widget/security/ir.model.access.csv b/image_capture_upload_widget/security/ir.model.access.csv new file mode 100644 index 000000000..6ad71571b --- /dev/null +++ b/image_capture_upload_widget/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_image_capture,access.image.capture,model_image_capture,base.group_user,1,1,1,1 diff --git a/image_capture_upload_widget/static/description/assets/icons/check.png b/image_capture_upload_widget/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/check.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/chevron.png b/image_capture_upload_widget/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/chevron.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/cogs.png b/image_capture_upload_widget/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/cogs.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/consultation.png b/image_capture_upload_widget/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/consultation.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/ecom-black.png b/image_capture_upload_widget/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/ecom-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/education-black.png b/image_capture_upload_widget/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/education-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/hotel-black.png b/image_capture_upload_widget/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/hotel-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/license.png b/image_capture_upload_widget/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/license.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/lifebuoy.png b/image_capture_upload_widget/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/lifebuoy.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/manufacturing-black.png b/image_capture_upload_widget/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/manufacturing-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/pos-black.png b/image_capture_upload_widget/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/pos-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/puzzle.png b/image_capture_upload_widget/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/puzzle.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/restaurant-black.png b/image_capture_upload_widget/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/restaurant-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/service-black.png b/image_capture_upload_widget/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/service-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/trading-black.png b/image_capture_upload_widget/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/trading-black.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/training.png b/image_capture_upload_widget/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/training.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/update.png b/image_capture_upload_widget/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/update.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/user.png b/image_capture_upload_widget/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/user.png differ diff --git a/image_capture_upload_widget/static/description/assets/icons/wrench.png b/image_capture_upload_widget/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/icons/wrench.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/Cybrosys R.png b/image_capture_upload_widget/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/Cybrosys R.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/categories.png b/image_capture_upload_widget/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/categories.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/check-box.png b/image_capture_upload_widget/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/check-box.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/compass.png b/image_capture_upload_widget/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/compass.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/corporate.png b/image_capture_upload_widget/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/corporate.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/customer-support.png b/image_capture_upload_widget/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/customer-support.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/cybrosys-logo.png b/image_capture_upload_widget/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/cybrosys-logo.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/email.svg b/image_capture_upload_widget/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/features.png b/image_capture_upload_widget/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/features.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/logo.png b/image_capture_upload_widget/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/logo.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/phone.svg b/image_capture_upload_widget/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/pictures.png b/image_capture_upload_widget/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/pictures.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/pie-chart.png b/image_capture_upload_widget/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/pie-chart.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/right-arrow.png b/image_capture_upload_widget/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/right-arrow.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/star (1) 2.svg b/image_capture_upload_widget/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/star.png b/image_capture_upload_widget/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/star.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/support (1) 1.svg b/image_capture_upload_widget/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/support-email.svg b/image_capture_upload_widget/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/support.png b/image_capture_upload_widget/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/support.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/tick-mark.svg b/image_capture_upload_widget/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/whatsapp 1.svg b/image_capture_upload_widget/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/misc/whatsapp.png b/image_capture_upload_widget/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/misc/whatsapp.png differ diff --git a/image_capture_upload_widget/static/description/assets/misc/whatsapp.svg b/image_capture_upload_widget/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/image_capture_upload_widget/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/image_capture_upload_widget/static/description/assets/modules/1.png b/image_capture_upload_widget/static/description/assets/modules/1.png new file mode 100644 index 000000000..ba1058c42 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/1.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/2.png b/image_capture_upload_widget/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/2.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/3.png b/image_capture_upload_widget/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/3.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/4.png b/image_capture_upload_widget/static/description/assets/modules/4.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/4.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/5.gif b/image_capture_upload_widget/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/5.gif differ diff --git a/image_capture_upload_widget/static/description/assets/modules/5.png b/image_capture_upload_widget/static/description/assets/modules/5.png new file mode 100755 index 000000000..272ec20f9 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/5.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/6.png b/image_capture_upload_widget/static/description/assets/modules/6.png new file mode 100644 index 000000000..7d5c3154f Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/6.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/l2.png b/image_capture_upload_widget/static/description/assets/modules/l2.png new file mode 100644 index 000000000..f40a0756d Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/l2.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/l3.png b/image_capture_upload_widget/static/description/assets/modules/l3.png new file mode 100644 index 000000000..5738a486e Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/l3.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/l4.png b/image_capture_upload_widget/static/description/assets/modules/l4.png new file mode 100644 index 000000000..8d99e8c68 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/l4.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/l5.png b/image_capture_upload_widget/static/description/assets/modules/l5.png new file mode 100644 index 000000000..3415917c2 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/l5.png differ diff --git a/image_capture_upload_widget/static/description/assets/modules/l6.png b/image_capture_upload_widget/static/description/assets/modules/l6.png new file mode 100644 index 000000000..c7ea331ee Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/modules/l6.png differ diff --git a/image_capture_upload_widget/static/description/assets/screenshots/hero.gif b/image_capture_upload_widget/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..27e6cd6b8 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/screenshots/hero.gif differ diff --git a/image_capture_upload_widget/static/description/assets/screenshots/screenshot1.png b/image_capture_upload_widget/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..71257b834 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/screenshots/screenshot1.png differ diff --git a/image_capture_upload_widget/static/description/assets/screenshots/screenshot2.png b/image_capture_upload_widget/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..a77c3c38d Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/screenshots/screenshot2.png differ diff --git a/image_capture_upload_widget/static/description/assets/screenshots/screenshot3.png b/image_capture_upload_widget/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..b223ca068 Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/screenshots/screenshot3.png differ diff --git a/image_capture_upload_widget/static/description/assets/screenshots/screenshot4.png b/image_capture_upload_widget/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..b9cfd9a3a Binary files /dev/null and b/image_capture_upload_widget/static/description/assets/screenshots/screenshot4.png differ diff --git a/image_capture_upload_widget/static/description/banner.jpg b/image_capture_upload_widget/static/description/banner.jpg new file mode 100644 index 000000000..e8c16580d Binary files /dev/null and b/image_capture_upload_widget/static/description/banner.jpg differ diff --git a/image_capture_upload_widget/static/description/icon.png b/image_capture_upload_widget/static/description/icon.png new file mode 100644 index 000000000..470e84e76 Binary files /dev/null and b/image_capture_upload_widget/static/description/icon.png differ diff --git a/image_capture_upload_widget/static/description/index.html b/image_capture_upload_widget/static/description/index.html new file mode 100644 index 000000000..e4f1f0c96 --- /dev/null +++ b/image_capture_upload_widget/static/description/index.html @@ -0,0 +1,664 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Image Capture Widget

+

+ Image Capture Widget for Image Field +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Image Capture Widget

+

This module is used to Capture Image from our Webcam. It is a widget for + image fields to capture the images directly from the webcam. +

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

+ Configuration

+

+ Add the 'capture_image' as the widget of an image field and also make sure to give camera permission in the browser ,site settings

+
+
+
+
+
+ + +
+
+

+ Click the camera button to open the camera

+
+
+
+
+
+
+ + +
+
+

+ Click the 'Capture' button capture images.

+
+
+
+
+
+
+ + +
+
+

+ Click the 'Save Image' button saving the image.

+
+
+
+
+ +
+
+
    +
  • + Capturing Image from webcam +
  • +
  • + Enterprise and Community compatible. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:30th January 2024 +
+

+ + Initial Commit for Image Capture Widget.

+
+
+
+
+
+
+
+

+ 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/image_capture_upload_widget/static/src/js/image_capture.js b/image_capture_upload_widget/static/src/js/image_capture.js new file mode 100644 index 000000000..024febb9c --- /dev/null +++ b/image_capture_upload_widget/static/src/js/image_capture.js @@ -0,0 +1,249 @@ +/** @odoo-module **/ + +import { isMobileOS } from "@web/core/browser/feature_detection"; +import { _t } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; +import { useService } from "@web/core/utils/hooks"; +import { url } from "@web/core/utils/urls"; +import { isBinarySize } from "@web/core/utils/binary"; +import { jsonrpc } from "@web/core/network/rpc_service"; +import { FileUploader } from "@web/views/fields/file_handler"; +import { standardFieldProps } from "@web/views/fields/standard_field_props"; +import { Component, useState, onWillUpdateProps,useRef} from "@odoo/owl"; +const { DateTime } = luxon; +export const fileTypeMagicWordMap = { + "/": "jpg", + R: "gif", + i: "png", + P: "svg+xml", +}; + +const placeholder = "/web/static/img/placeholder.png"; +export function imageCacheKey(value) { + if (value instanceof DateTime) { + return value.ts; + } + return ""; +} +class imageCapture extends Component { + static template = "CaptureImage"; + static components = { + FileUploader,}; + static props = { + ...standardFieldProps, + enableZoom: { type: Boolean, optional: true }, + zoomDelay: { type: Number, optional: true }, + previewImage: { type: String, optional: true }, + acceptedFileExtensions: { type: String, optional: true }, + width: { type: Number, optional: true }, + height: { type: Number, optional: true }, + reload: { type: Boolean, optional: true }, + }; + static defaultProps = { + acceptedFileExtensions: "image/*", + reload: true, + }; + setup() { + this.notification = useService("notification"); + this.orm = useService("orm") + this.isMobile = isMobileOS(); + this.state = useState({ + isValid: true, + stream: null, + + }); + this.player = useRef("player"); + this.capture = useRef("capture"); + this.camera = useRef("camera"); + this.save_image = useRef("save_image"); + this.rawCacheKey = this.props.record.data.write_date; + onWillUpdateProps((nextProps) => { + const { record } = this.props; + const { record: nextRecord } = nextProps; + if (record.resId !== nextRecord.resId || nextRecord.mode === "readonly") { + this.rawCacheKey = nextRecord.data.write_date; + } + }); + } + + get sizeStyle() { + // For getting image style details + let style = ""; + if (this.props.width) { + style += `max-width: ${this.props.width}px;`; + } + if (this.props.height) { + style += `max-height: ${this.props.height}px;`; + } + return style; + } + get hasTooltip() { + return ( + this.props.enableZoom && this.props.readonly && this.props.record.data[this.props.name] + ); + } + getUrl(previewFieldName) { + // getting the details and url of the image + if (!this.props.reload && this.lastURL) { + return this.lastURL; + } + if (this.state.isValid && this.props.record.data[this.props.name]) { + if (isBinarySize(this.props.record.data[this.props.name])) { + if (!this.rawCacheKey) { + this.rawCacheKey = this.props.record.data.write_date; + } + this.lastURL = url("/web/image", { + model: this.props.record.resModel, + id: this.props.record.resId, + field: previewFieldName, + unique: imageCacheKey(this.rawCacheKey), + }); + } else { + // Use magic-word technique for detecting image type + const magic = + fileTypeMagicWordMap[this.props.record.data[this.props.name][0]] || "png"; + this.lastURL = `data:image/${magic};base64,${ + this.props.record.data[this.props.name] + }`; + } + return this.lastURL; + } + return placeholder; + } + onFileRemove() { + // removing the images + this.state.isValid = true; + this.props.record.update({ [this.props.name]: false }); + } + async onFileUploaded(info) { + // Upload the images + this.state.isValid = true; + this.rawCacheKey = null; + this.props.record.update({ [this.props.name]: info.data }); + } + onFileCaptureImage() { + // Open a window for open the image and capture it + var field = this.props.name; + var id = this.props.record.data.id; + var model = this.props.record.resModel; + } + async OnClickOpenCamera() { + // opening the camera for capture the image + this.player.el.classList.remove('d-none'); + this.capture.el.classList.remove('d-none'); + this.camera.el.classList.add('d-none'); + this.state.stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: false }); + this.player.el.srcObject = this.state.stream; + } + stopTracksOnMediaStream(mediaStream) { + for (const track of mediaStream.getTracks()) { + track.stop(); + } + } + async OnClickCaptureImage() { + // Capture the image from webcam and close the webcam + var context = snapshot.getContext('2d'); + var canvas = document.getElementById('snapshot') + var image = document.getElementById('image'); + this.save_image.el.classList.remove('d-none'); + context.drawImage(player, 0, 0, 320, 240); + image.value = context.canvas.toDataURL(); + canvas.classList.remove('d-none'); + this.url = context.canvas.toDataURL(); + } + async OnClickSaveImage(){ + // Saving the image to that field + var self = this + await jsonrpc('/web/dataset/call_kw', { + model: 'image.capture', + method: 'action_save_image', + args: [[], this.url], + kwargs: {} + }).then(function(results){ + self.props.value = results + var data = { + data: results, + name : "ImageFile.png", + objectUrl: null, + size : 106252, + type: "image/png" + } + self.onFileUploaded(data) + }) + this.player.el.classList.add('d-none'); + var snapshot = document.getElementById('snapshot') + snapshot.classList.add('d-none'); + this.capture.el.classList.add('d-none'); + this.save_image.el.classList.add('d-none'); + this.camera.el.classList.remove('d-none'); + this.player.el.srcObject = null; + if (!this.state.stream) { + return; + } + this.stopTracksOnMediaStream(this.state.stream); + this.state.stream = null; + } + onLoadFailed() { + this.state.isValid = false; + this.notification.add(this.env._t("Could not display the selected image"), { + type: "danger", + }); + } +} +export const ImageCapture = { + component: imageCapture, + displayName: _t("Image"), + supportedOptions: [ + { + label: _t("Reload"), + name: "reload", + type: "boolean", + default: true, + }, + { + label: _t("Enable zoom"), + name: "zoom", + type: "boolean", + }, + { + label: _t("Zoom delay"), + name: "zoom_delay", + type: "number", + help: _t("Delay the apparition of the zoomed image with a value in milliseconds"), + }, + { + label: _t("Accepted file extensions"), + name: "accepted_file_extensions", + type: "string", + }, + { + label: _t("Size"), + name: "size", + type: "selection", + choices: [ + { label: _t("Small"), value: "[0,90]" }, + { label: _t("Medium"), value: "[0,180]" }, + { label: _t("Large"), value: "[0,270]" }, + ], + }, + { + label: _t("Preview image"), + name: "preview_image", + type: "field", + availableTypes: ["binary"], + }, + ], +supportedTypes: ["binary"], + fieldDependencies: [{ name: "write_date", type: "datetime" }], + isEmpty: () => false, + extractProps: ({ attrs, options }) => ({ + enableZoom: options.zoom, + zoomDelay: options.zoom_delay, + previewImage: options.preview_image, + acceptedFileExtensions: options.accepted_file_extensions, + width: options.size && Boolean(options.size[0]) ? options.size[0] : attrs.width, + height: options.size && Boolean(options.size[1]) ? options.size[1] : attrs.height, + reload: "reload" in options ? Boolean(options.reload) : true, + }), +}; +registry.category("fields").add("capture_image", ImageCapture); \ No newline at end of file diff --git a/image_capture_upload_widget/static/src/scss/image_capture.scss b/image_capture_upload_widget/static/src/scss/image_capture.scss new file mode 100644 index 000000000..e1bb3bec0 --- /dev/null +++ b/image_capture_upload_widget/static/src/scss/image_capture.scss @@ -0,0 +1,18 @@ +.o_field_image { + background-color: var(--ImageField-background-color, transparent); + + button { + transition: opacity ease 400ms; + width: 26px; + height: 26px; + } + + .o_mobile_controls { + button { + width: 30px; + height: 30px; + padding: 6px !important; + } + } +} + diff --git a/image_capture_upload_widget/static/src/xml/image_capture_templates.xml b/image_capture_upload_widget/static/src/xml/image_capture_templates.xml new file mode 100644 index 000000000..b839f309d --- /dev/null +++ b/image_capture_upload_widget/static/src/xml/image_capture_templates.xml @@ -0,0 +1,66 @@ + + + + +
+
+ + + + + + + + +
Capture +
+
Save Image +
+
+
+ + Binary file + +
+
+
diff --git a/image_capture_upload_widget/wizard/__init__.py b/image_capture_upload_widget/wizard/__init__.py new file mode 100644 index 000000000..952ef9103 --- /dev/null +++ b/image_capture_upload_widget/wizard/__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 image_capture diff --git a/image_capture_upload_widget/wizard/image_capture.py b/image_capture_upload_widget/wizard/image_capture.py new file mode 100644 index 000000000..536d1f508 --- /dev/null +++ b/image_capture_upload_widget/wizard/image_capture.py @@ -0,0 +1,36 @@ +# -*- 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 models + + +class ImageCapture(models.TransientModel): + """A model for capturing images""" + _name = 'image.capture' + _description = 'Image Captures' + + def action_save_image(self, url): + """ + Saving the images to corresponding models + :param url: Image details. + """ + image = url.split(',') + return image[1]