diff --git a/import_images_from_zip_file/README.rst b/import_images_from_zip_file/README.rst new file mode 100644 index 000000000..65c5faf98 --- /dev/null +++ b/import_images_from_zip_file/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-green.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Import Images +========================= +* This module is used to import images from zip file on the basis of various parameters + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V15) Nila UJ, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@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/import_images_from_zip_file/__init__.py b/import_images_from_zip_file/__init__.py new file mode 100644 index 000000000..a51d5bfb1 --- /dev/null +++ b/import_images_from_zip_file/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: NILA UJ (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/import_images_from_zip_file/__manifest__.py b/import_images_from_zip_file/__manifest__.py new file mode 100644 index 000000000..1a1f05cf9 --- /dev/null +++ b/import_images_from_zip_file/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: NILA UJ (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': "Import Images From Zip File", + 'version': '15.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Used to Import Images""", + 'description': """Can import images from zip file on the basis of + various parameters""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['sale_management', 'contacts', 'hr'], + 'data': [ + 'security/ir.model.access.csv', + 'wizard/import_image.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'import_images_from_zip_file/static/src/js/import_button.js', + ], + 'web.assets_qweb': [ + 'import_images_from_zip_file/static/src/xml/import_button.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/import_images_from_zip_file/doc/RELEASE_NOTES.md b/import_images_from_zip_file/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..8e14e86a1 --- /dev/null +++ b/import_images_from_zip_file/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 24.05.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial commit for Import Images From Zip File diff --git a/import_images_from_zip_file/security/ir.model.access.csv b/import_images_from_zip_file/security/ir.model.access.csv new file mode 100644 index 000000000..5cbef8357 --- /dev/null +++ b/import_images_from_zip_file/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_import_images_from_zip_file,access_import_images_from_zip_file,model_import_image,base.group_system,1,1,1,1 diff --git a/import_images_from_zip_file/static/description/assets/icons/check.png b/import_images_from_zip_file/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/check.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/chevron.png b/import_images_from_zip_file/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/chevron.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/cogs.png b/import_images_from_zip_file/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/cogs.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/consultation.png b/import_images_from_zip_file/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/consultation.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/ecom-black.png b/import_images_from_zip_file/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/ecom-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/education-black.png b/import_images_from_zip_file/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/education-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/hotel-black.png b/import_images_from_zip_file/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/hotel-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/license.png b/import_images_from_zip_file/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/license.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/lifebuoy.png b/import_images_from_zip_file/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/lifebuoy.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/logo.png b/import_images_from_zip_file/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/logo.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/manufacturing-black.png b/import_images_from_zip_file/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/manufacturing-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/pos-black.png b/import_images_from_zip_file/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/pos-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/puzzle.png b/import_images_from_zip_file/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/puzzle.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/restaurant-black.png b/import_images_from_zip_file/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/restaurant-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/service-black.png b/import_images_from_zip_file/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/service-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/trading-black.png b/import_images_from_zip_file/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/trading-black.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/training.png b/import_images_from_zip_file/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/training.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/update.png b/import_images_from_zip_file/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/update.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/user.png b/import_images_from_zip_file/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/user.png differ diff --git a/import_images_from_zip_file/static/description/assets/icons/wrench.png b/import_images_from_zip_file/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/icons/wrench.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/categories.png b/import_images_from_zip_file/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/categories.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/check-box.png b/import_images_from_zip_file/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/check-box.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/compass.png b/import_images_from_zip_file/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/compass.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/corporate.png b/import_images_from_zip_file/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/corporate.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/customer-support.png b/import_images_from_zip_file/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/customer-support.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/cybrosys-logo.png b/import_images_from_zip_file/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/cybrosys-logo.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/features.png b/import_images_from_zip_file/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/features.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/logo.png b/import_images_from_zip_file/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/logo.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/pictures.png b/import_images_from_zip_file/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/pictures.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/pie-chart.png b/import_images_from_zip_file/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/pie-chart.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/right-arrow.png b/import_images_from_zip_file/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/right-arrow.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/star.png b/import_images_from_zip_file/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/star.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/support.png b/import_images_from_zip_file/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/support.png differ diff --git a/import_images_from_zip_file/static/description/assets/misc/whatsapp.png b/import_images_from_zip_file/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/misc/whatsapp.png differ diff --git a/import_images_from_zip_file/static/description/assets/modules/barcode_image.png b/import_images_from_zip_file/static/description/assets/modules/barcode_image.png new file mode 100644 index 000000000..cfb5be33c Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/modules/barcode_image.png differ diff --git a/import_images_from_zip_file/static/description/assets/modules/biometric_image.png b/import_images_from_zip_file/static/description/assets/modules/biometric_image.png new file mode 100644 index 000000000..a0969fcb5 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/modules/biometric_image.png differ diff --git a/import_images_from_zip_file/static/description/assets/modules/export_image.png b/import_images_from_zip_file/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..492980ad0 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/modules/export_image.png differ diff --git a/import_images_from_zip_file/static/description/assets/modules/login_image.png b/import_images_from_zip_file/static/description/assets/modules/login_image.png new file mode 100644 index 000000000..4fbe85ac1 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/modules/login_image.png differ diff --git a/import_images_from_zip_file/static/description/assets/modules/payroll_image.png b/import_images_from_zip_file/static/description/assets/modules/payroll_image.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/modules/payroll_image.png differ diff --git a/import_images_from_zip_file/static/description/assets/modules/sale_image.png b/import_images_from_zip_file/static/description/assets/modules/sale_image.png new file mode 100644 index 000000000..004c61a9e Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/modules/sale_image.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/1.png b/import_images_from_zip_file/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..2ccee77c9 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/1.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/10.png b/import_images_from_zip_file/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..7624a2316 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/10.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/11.png b/import_images_from_zip_file/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..8f64c6848 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/11.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/12.png b/import_images_from_zip_file/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..8fed66189 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/12.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/2.png b/import_images_from_zip_file/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..16c56d985 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/2.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/3.png b/import_images_from_zip_file/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..3881eccdc Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/3.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/4.png b/import_images_from_zip_file/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..bc90e7f34 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/4.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/5.png b/import_images_from_zip_file/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..c00164092 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/5.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/6.png b/import_images_from_zip_file/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..85e347315 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/6.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/7.png b/import_images_from_zip_file/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..aec6147ee Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/7.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/8.png b/import_images_from_zip_file/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..d6e9f86b5 Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/8.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/9.png b/import_images_from_zip_file/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..a8840b40d Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/9.png differ diff --git a/import_images_from_zip_file/static/description/assets/screenshots/v15-hero.gif b/import_images_from_zip_file/static/description/assets/screenshots/v15-hero.gif new file mode 100644 index 000000000..50db12bec Binary files /dev/null and b/import_images_from_zip_file/static/description/assets/screenshots/v15-hero.gif differ diff --git a/import_images_from_zip_file/static/description/banner.jpg b/import_images_from_zip_file/static/description/banner.jpg new file mode 100644 index 000000000..d53244d25 Binary files /dev/null and b/import_images_from_zip_file/static/description/banner.jpg differ diff --git a/import_images_from_zip_file/static/description/icon.png b/import_images_from_zip_file/static/description/icon.png new file mode 100644 index 000000000..405d71a2e Binary files /dev/null and b/import_images_from_zip_file/static/description/icon.png differ diff --git a/import_images_from_zip_file/static/description/index.html b/import_images_from_zip_file/static/description/index.html new file mode 100644 index 000000000..e2e9ecf87 --- /dev/null +++ b/import_images_from_zip_file/static/description/index.html @@ -0,0 +1,641 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Import Images From Zip File

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ This module will help you to import images from zip file on the basis of + various parameters. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Easily import images from a zip file without any hassle. + +
+
+ + Import images to product template on basis of name, internal reference, barcode +
+
+ + Import images to product variants on basis of internal reference, barcode +
+
+ + Import images to employee on basis of name, identification no. +
+
+ + Import images to partner on basis of name. +
+
+
+ + +
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Import Images from Zip File. +

+

+ Import images to product template on basis of name, Internal + reference, barcode

+ + + + +

+ Import images to product variants on basis of internal + reference, Barcode

+ + + +

+ Import images to employee on basis of name, identification + no.

+ + + +

+ Import images to partner on basis of name.

+ + +
+
+
+ + + +
+
+

Suggested 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/import_images_from_zip_file/static/src/js/import_button.js b/import_images_from_zip_file/static/src/js/import_button.js new file mode 100644 index 000000000..55c83a984 --- /dev/null +++ b/import_images_from_zip_file/static/src/js/import_button.js @@ -0,0 +1,32 @@ +odoo.define('import_images_from_zip_file.FileImport', function (require) { +"use strict"; + + var core = require('web.core'); + var ListController = require('web.ListController'); + var _t = core._t; + /** + * ListController used to bind button with list view + */ + + ListController.include({ + renderButtons: function($node) { + this._super.apply(this, arguments); + if (this.$buttons) { + this.$buttons.find('.new').click(this.proxy('view_wizard')) ; + } + }, + view_wizard: function () { + this.do_action({ + _name : _t('View Wizard'), + type: 'ir.actions.act_window', + res_model: 'import.image', + views: [[false, 'form']], + view_mode: 'form', + context: { + default_model_template:this.modelName, + }, + target: 'new', + }); + } + }) +}); \ No newline at end of file diff --git a/import_images_from_zip_file/static/src/xml/import_button.xml b/import_images_from_zip_file/static/src/xml/import_button.xml new file mode 100644 index 000000000..15da75c2c --- /dev/null +++ b/import_images_from_zip_file/static/src/xml/import_button.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/import_images_from_zip_file/wizard/__init__.py b/import_images_from_zip_file/wizard/__init__.py new file mode 100644 index 000000000..c72e8ce0a --- /dev/null +++ b/import_images_from_zip_file/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: NILA UJ (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 import_image diff --git a/import_images_from_zip_file/wizard/import_image.py b/import_images_from_zip_file/wizard/import_image.py new file mode 100644 index 000000000..2d3b6cb47 --- /dev/null +++ b/import_images_from_zip_file/wizard/import_image.py @@ -0,0 +1,145 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: NILA UJ (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +import base64 +import tempfile +import io +import zipfile +from odoo import fields, models, _ +from odoo.exceptions import ValidationError + + +class ImportImage(models.TransientModel): + _name = "import.image" + _description = 'Import Image Wizard' + + file = fields.Binary(string="Zip", help="Binary file") + reference = fields.Selection(selection='_get_reference', + help="Choose what type of reference the " + "image files are named after", + string="Based on") + model_template = fields.Selection([ + ('product.template', "Product Template"), + ('product.product', "Product Product"), + ('hr.employee', "Employee"), + ('res.partner', "Partner"), + ], help="Choose what type of reference the image files are named after", + string="Model Template", readonly=True) + + def _get_reference(self): + """ + Function for retrieving the value for selection field + :type : list(str) + :returns: list(str) + """ + model = self._context.get('default_model_template') + selection = False + if model == "product.template": + selection = [ + ('name', "Name"), + ('internal_reference', "Internal Reference"), + ('barcode', "Barcode"), + ] + elif model == "product.product": + selection = [ + ('internal_reference', "Internal Reference"), + ('barcode', "Barcode"), + ] + elif model == "hr.employee": + selection = [ + ('name', "Name"), + ('identification_no', "Identification No"), + ] + elif model == "res.partner": + selection = [ + ('name', "Name"), + ] + return selection + + def action_import(self): + """Function for importing images + :type : list(str) + :returns: action definition to open wizard view + """ + model = False + if self.model_template: + model = self.model_template + if not self.reference: + raise ValidationError( + _('Please choose all options')) + elif not self.file: + raise ValidationError( + _('Please choose a zip file')) + + file = base64.decodebytes(self.file) + fileobject = tempfile.NamedTemporaryFile(delete=False) + fname = fileobject.name + fileobject.write(file) + fileobject.close() + + file_zip = self.file + main_file = open(fname, 'r+b') + data = main_file.read() + main_file.write(base64.b64decode(file_zip)) + pos = data.find(b'\x50\x4b\x05\x06') + main_file.seek(pos + 22) + try: + with zipfile.ZipFile(main_file, 'r') as zip_file: + path_list = [] + converted_string_list = [] + + for name in zip_file.namelist(): + path_list.append(name) + converted_string_list.append(zip_file.read(name)) + + binary_file_list = [] + for binary_file in converted_string_list: + binary_file_list.append(base64.b64encode + (io.BytesIO(binary_file).read())) + main_file.close() + + for binary_image, record_reference \ + in zip(binary_file_list, path_list): + if self.reference == 'name' and model != 'product.product': + record = self.env[model].search( + [('name', 'ilike', record_reference.split('.', 1)[0])]) + if self.reference == 'internal_reference' \ + and model != 'hr.employee': + record = self.env[model].search( + [('default_code', 'ilike', record_reference.split('.', 1)[0])]) + if self.reference == 'barcode' and model != 'res.partner' \ + and model != 'hr.employee': + record = self.env[model].search( + [('barcode', 'ilike', record_reference.split('.', 1)[0])]) + if self.reference == 'identification_no' \ + and model != 'res.partner' \ + and model != 'product.product' \ + and model != 'product.template': + record = self.env[model].search( + [('identification_id', 'ilike', record_reference.split('.', 1)[0])]) + record.image_1920 = binary_image + + return { + 'type': 'ir.actions.client', + 'tag': 'reload', + } + except zipfile.BadZipfile: + raise ValidationError(_('Please upload a zip file')) diff --git a/import_images_from_zip_file/wizard/import_image.xml b/import_images_from_zip_file/wizard/import_image.xml new file mode 100644 index 000000000..d7a5f7866 --- /dev/null +++ b/import_images_from_zip_file/wizard/import_image.xml @@ -0,0 +1,36 @@ + + + + + import.image.view.form + import.image + +
+ + + + + + + +
+
+
+
+
+ + + Import Images + import.image + form + + new + +
\ No newline at end of file