diff --git a/product_import/README.rst b/product_import/README.rst new file mode 100644 index 000000000..618922d63 --- /dev/null +++ b/product_import/README.rst @@ -0,0 +1,57 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Product Image from URL +====================== +Product Image from URL and Local Paths. + +Features +======== +* This module enables to add Product Images from Web URLs and Local Paths. + +Configuration +============= +Nothing to configure. + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Mohammed Shahil MP, + (V14) Minhaj T, + (V15) Minhaj T, + (V16) Amaya Aravind, + (V17) Aysha Shalin, + (V18) Sreerag PM, + + 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/product_import/__init__.py b/product_import/__init__.py new file mode 100644 index 000000000..54e2bb4fc --- /dev/null +++ b/product_import/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sreerag PM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import wizard +from . import models diff --git a/product_import/__manifest__.py b/product_import/__manifest__.py new file mode 100644 index 000000000..4bdc90f55 --- /dev/null +++ b/product_import/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sreerag PM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Product Image from URL', + 'version': '18.0.1.0.0', + 'category': 'Sales', + 'summary': 'Product Images from Web URLs and Local Paths', + 'description': """This module enables to add Product Images from Web URLs + and Local Paths""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['sale'], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_template_views.xml', + 'views/product_product_views.xml', + 'wizard/product_import_views.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/product_import/demo/phone.jpeg b/product_import/demo/phone.jpeg new file mode 100644 index 000000000..d2aadaa42 Binary files /dev/null and b/product_import/demo/phone.jpeg differ diff --git a/product_import/demo/product.csv b/product_import/demo/product.csv new file mode 100644 index 000000000..48fb30227 --- /dev/null +++ b/product_import/demo/product.csv @@ -0,0 +1,4 @@ +Product name,product type,Barcode,Price,Image +Laptop,consu,5465465554,25000,https://images-na.ssl-images-amazon.com/images/I/81xe3aoU6BL._AC_SL1500_.jpg +smart phone,consu,7081234174,35000,/home/cybrosys/odoo18/custom_migration/product_import/demo/phone.jpeg +bike,service,8720132165,2700, diff --git a/product_import/demo/product.xlsx b/product_import/demo/product.xlsx new file mode 100644 index 000000000..f6b31713b Binary files /dev/null and b/product_import/demo/product.xlsx differ diff --git a/product_import/demo/watch.jpg b/product_import/demo/watch.jpg new file mode 100644 index 000000000..13651c909 Binary files /dev/null and b/product_import/demo/watch.jpg differ diff --git a/product_import/doc/RELEASE_NOTES.md b/product_import/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..82920dabb --- /dev/null +++ b/product_import/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 04.02.2025 +#### Version 18.0.1.0.0 +##### ADD +- Initial Commit for Product Image from URL diff --git a/product_import/models/__init__.py b/product_import/models/__init__.py new file mode 100644 index 000000000..7db42e6b9 --- /dev/null +++ b/product_import/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sreerag PM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import product_template diff --git a/product_import/models/product_template.py b/product_import/models/product_template.py new file mode 100644 index 000000000..4a1d4c7f6 --- /dev/null +++ b/product_import/models/product_template.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sreerag PM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import base64 +import requests +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class ProductTemplate(models.Model): + """ Inheriting 'product.template' for adding image url """ + _inherit = 'product.template' + + image_url = fields.Char(string='Image URL', help="Url of Image") + image_added = fields.Binary("Image (1920x1920)", + compute='_compute_image_added', store=True, + help="Uploaded Image") + + @api.depends('image_url') + def _compute_image_added(self): + """ Function to load an image from URL or local file path """ + for record in self: + image = False + if record.image_url: + if record.image_url.startswith(('http://', 'https://')): + # Load image from URL + try: + image = base64.b64encode( + requests.get(record.image_url).content) + except Exception as e: + raise UserError( + _("Error loading image from URL: %s" % str(e))) + else: + # Load image from local file path + try: + with open(record.image_url, 'rb') as image_file: + image = base64.b64encode(image_file.read()) + except Exception as e: + raise UserError( + _("Error loading image from local path: %s" % str( + e))) + + # Set the binary image fields + if image: + record.image_1920 = image + record.image_added = image # To update your custom field too + + +class ProductVariantImage(models.Model): + """ Inheriting 'product.product' for adding image url """ + _inherit = 'product.product' + + image_url = fields.Char(string='Image URL', help="Url of Image") + image_added = fields.Binary("Image (1920x1920)", + compute='_compute_image_added', store=True, + help="Uploaded Image") + + @api.depends('image_url') + def _compute_image_added(self): + """ Function to load an image from URL or local file path """ + for record in self: + image = False + if record.image_url: + if record.image_url.startswith(('http://', 'https://')): + # Load image from URL + try: + image = base64.b64encode( + requests.get(record.image_url).content) + except Exception as e: + raise UserError( + _("Error loading image from URL: %s" % str(e))) + else: + # Load image from local file path + try: + with open(record.image_url, 'rb') as image_file: + image = base64.b64encode(image_file.read()) + except Exception as e: + raise UserError( + _("Error loading image from local path: %s" % str( + e))) + + # Set the binary image fields + if image: + record.image_1920 = image + record.image_added = image # To update your custom field too diff --git a/product_import/security/ir.model.access.csv b/product_import/security/ir.model.access.csv new file mode 100644 index 000000000..f804b803f --- /dev/null +++ b/product_import/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_product_import_product_import,product_import.product_import,model_product_import,base.group_user,1,1,1,1 diff --git a/product_import/static/description/assets/cybro-icon.png b/product_import/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/product_import/static/description/assets/cybro-icon.png differ diff --git a/product_import/static/description/assets/cybro-odoo.png b/product_import/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/product_import/static/description/assets/cybro-odoo.png differ diff --git a/product_import/static/description/assets/h2.png b/product_import/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/product_import/static/description/assets/h2.png differ diff --git a/product_import/static/description/assets/icons/arrows-repeat.svg b/product_import/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/product_import/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/banner-1.png b/product_import/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/product_import/static/description/assets/icons/banner-1.png differ diff --git a/product_import/static/description/assets/icons/banner-2.svg b/product_import/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/product_import/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/banner-bg.png b/product_import/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/product_import/static/description/assets/icons/banner-bg.png differ diff --git a/product_import/static/description/assets/icons/banner-bg.svg b/product_import/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/product_import/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_import/static/description/assets/icons/banner-call.svg b/product_import/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/product_import/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/product_import/static/description/assets/icons/banner-mail.svg b/product_import/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/product_import/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/product_import/static/description/assets/icons/banner-pattern.svg b/product_import/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/product_import/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/banner-promo.svg b/product_import/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/product_import/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/brand-pair.svg b/product_import/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/product_import/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/check.png b/product_import/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/product_import/static/description/assets/icons/check.png differ diff --git a/product_import/static/description/assets/icons/chevron.png b/product_import/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/product_import/static/description/assets/icons/chevron.png differ diff --git a/product_import/static/description/assets/icons/close-icon.svg b/product_import/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/product_import/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/product_import/static/description/assets/icons/cogs.png b/product_import/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/product_import/static/description/assets/icons/cogs.png differ diff --git a/product_import/static/description/assets/icons/collabarate-icon.svg b/product_import/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/product_import/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_import/static/description/assets/icons/consultation.png b/product_import/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/product_import/static/description/assets/icons/consultation.png differ diff --git a/product_import/static/description/assets/icons/cybro-logo.png b/product_import/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/product_import/static/description/assets/icons/cybro-logo.png differ diff --git a/product_import/static/description/assets/icons/down.svg b/product_import/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/product_import/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/product_import/static/description/assets/icons/ecom-black.png b/product_import/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/product_import/static/description/assets/icons/ecom-black.png differ diff --git a/product_import/static/description/assets/icons/education-black.png b/product_import/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/product_import/static/description/assets/icons/education-black.png differ diff --git a/product_import/static/description/assets/icons/faq.png b/product_import/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/product_import/static/description/assets/icons/faq.png differ diff --git a/product_import/static/description/assets/icons/feature-icon.svg b/product_import/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/product_import/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/feature.png b/product_import/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/product_import/static/description/assets/icons/feature.png differ diff --git a/product_import/static/description/assets/icons/gear.svg b/product_import/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/product_import/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/hero.gif b/product_import/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/product_import/static/description/assets/icons/hero.gif differ diff --git a/product_import/static/description/assets/icons/hire-odoo.svg b/product_import/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/product_import/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/hotel-black.png b/product_import/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/product_import/static/description/assets/icons/hotel-black.png differ diff --git a/product_import/static/description/assets/icons/license.png b/product_import/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/product_import/static/description/assets/icons/license.png differ diff --git a/product_import/static/description/assets/icons/life-ring-icon.svg b/product_import/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/product_import/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/lifebuoy.png b/product_import/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/product_import/static/description/assets/icons/lifebuoy.png differ diff --git a/product_import/static/description/assets/icons/mail.svg b/product_import/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/product_import/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_import/static/description/assets/icons/manufacturing-black.png b/product_import/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/product_import/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_import/static/description/assets/icons/notes.png b/product_import/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/product_import/static/description/assets/icons/notes.png differ diff --git a/product_import/static/description/assets/icons/notification icon.svg b/product_import/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/product_import/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/odoo-consultancy.svg b/product_import/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/product_import/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/product_import/static/description/assets/icons/odoo-licencing.svg b/product_import/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/product_import/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_import/static/description/assets/icons/odoo-logo.png b/product_import/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/product_import/static/description/assets/icons/odoo-logo.png differ diff --git a/product_import/static/description/assets/icons/patter.svg b/product_import/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/product_import/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_import/static/description/assets/icons/pattern1.png b/product_import/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/product_import/static/description/assets/icons/pattern1.png differ diff --git a/product_import/static/description/assets/icons/pos-black.png b/product_import/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/product_import/static/description/assets/icons/pos-black.png differ diff --git a/product_import/static/description/assets/icons/puzzle-piece-icon.svg b/product_import/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/product_import/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/puzzle.png b/product_import/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/product_import/static/description/assets/icons/puzzle.png differ diff --git a/product_import/static/description/assets/icons/replace-icon.svg b/product_import/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/product_import/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/restaurant-black.png b/product_import/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/product_import/static/description/assets/icons/restaurant-black.png differ diff --git a/product_import/static/description/assets/icons/screenshot-main.png b/product_import/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/product_import/static/description/assets/icons/screenshot-main.png differ diff --git a/product_import/static/description/assets/icons/screenshot.png b/product_import/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/product_import/static/description/assets/icons/screenshot.png differ diff --git a/product_import/static/description/assets/icons/service-black.png b/product_import/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/product_import/static/description/assets/icons/service-black.png differ diff --git a/product_import/static/description/assets/icons/skype-fill.svg b/product_import/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/product_import/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/skype.png b/product_import/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/product_import/static/description/assets/icons/skype.png differ diff --git a/product_import/static/description/assets/icons/skype.svg b/product_import/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/product_import/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/product_import/static/description/assets/icons/star-1.svg b/product_import/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/product_import/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/star-2.svg b/product_import/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/product_import/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/product_import/static/description/assets/icons/support.png b/product_import/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/product_import/static/description/assets/icons/support.png differ diff --git a/product_import/static/description/assets/icons/test-1 - Copy.png b/product_import/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/product_import/static/description/assets/icons/test-1 - Copy.png differ diff --git a/product_import/static/description/assets/icons/test-1.png b/product_import/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/product_import/static/description/assets/icons/test-1.png differ diff --git a/product_import/static/description/assets/icons/test-2.png b/product_import/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/product_import/static/description/assets/icons/test-2.png differ diff --git a/product_import/static/description/assets/icons/trading-black.png b/product_import/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/product_import/static/description/assets/icons/trading-black.png differ diff --git a/product_import/static/description/assets/icons/training.png b/product_import/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/product_import/static/description/assets/icons/training.png differ diff --git a/product_import/static/description/assets/icons/translate.svg b/product_import/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/product_import/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/update.png b/product_import/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/product_import/static/description/assets/icons/update.png differ diff --git a/product_import/static/description/assets/icons/user.png b/product_import/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/product_import/static/description/assets/icons/user.png differ diff --git a/product_import/static/description/assets/icons/video.png b/product_import/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/product_import/static/description/assets/icons/video.png differ diff --git a/product_import/static/description/assets/icons/whatsapp.png b/product_import/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/product_import/static/description/assets/icons/whatsapp.png differ diff --git a/product_import/static/description/assets/icons/wrench-icon.svg b/product_import/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/product_import/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/product_import/static/description/assets/icons/wrench.png b/product_import/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/product_import/static/description/assets/icons/wrench.png differ diff --git a/product_import/static/description/assets/modules/1.jpg b/product_import/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..0178d2964 Binary files /dev/null and b/product_import/static/description/assets/modules/1.jpg differ diff --git a/product_import/static/description/assets/modules/2.jpg b/product_import/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..580ea075d Binary files /dev/null and b/product_import/static/description/assets/modules/2.jpg differ diff --git a/product_import/static/description/assets/modules/3.png b/product_import/static/description/assets/modules/3.png new file mode 100644 index 000000000..662660527 Binary files /dev/null and b/product_import/static/description/assets/modules/3.png differ diff --git a/product_import/static/description/assets/modules/4.jpg b/product_import/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..cd5fffdd6 Binary files /dev/null and b/product_import/static/description/assets/modules/4.jpg differ diff --git a/product_import/static/description/assets/modules/5.jpg b/product_import/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..73613d2fb Binary files /dev/null and b/product_import/static/description/assets/modules/5.jpg differ diff --git a/product_import/static/description/assets/modules/6.png b/product_import/static/description/assets/modules/6.png new file mode 100644 index 000000000..5a36b384e Binary files /dev/null and b/product_import/static/description/assets/modules/6.png differ diff --git a/product_import/static/description/assets/screenshots/1.png b/product_import/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..bfe5e5e8a Binary files /dev/null and b/product_import/static/description/assets/screenshots/1.png differ diff --git a/product_import/static/description/assets/screenshots/2.png b/product_import/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..a5362591d Binary files /dev/null and b/product_import/static/description/assets/screenshots/2.png differ diff --git a/product_import/static/description/assets/screenshots/3.png b/product_import/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..0ffaa4acd Binary files /dev/null and b/product_import/static/description/assets/screenshots/3.png differ diff --git a/product_import/static/description/assets/screenshots/4.png b/product_import/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..27dbebb76 Binary files /dev/null and b/product_import/static/description/assets/screenshots/4.png differ diff --git a/product_import/static/description/assets/screenshots/5.png b/product_import/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..66624ae71 Binary files /dev/null and b/product_import/static/description/assets/screenshots/5.png differ diff --git a/product_import/static/description/assets/screenshots/6.png b/product_import/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..f1ca3190e Binary files /dev/null and b/product_import/static/description/assets/screenshots/6.png differ diff --git a/product_import/static/description/assets/screenshots/7.png b/product_import/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..25b3d43ca Binary files /dev/null and b/product_import/static/description/assets/screenshots/7.png differ diff --git a/product_import/static/description/assets/screenshots/8.png b/product_import/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..4ce2d16be Binary files /dev/null and b/product_import/static/description/assets/screenshots/8.png differ diff --git a/product_import/static/description/assets/screenshots/hero.gif b/product_import/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..1d0cfa91a Binary files /dev/null and b/product_import/static/description/assets/screenshots/hero.gif differ diff --git a/product_import/static/description/assets/y18.jpg b/product_import/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/product_import/static/description/assets/y18.jpg differ diff --git a/product_import/static/description/banner.jpg b/product_import/static/description/banner.jpg new file mode 100644 index 000000000..3302c6e60 Binary files /dev/null and b/product_import/static/description/banner.jpg differ diff --git a/product_import/static/description/icon.png b/product_import/static/description/icon.png new file mode 100644 index 000000000..458de3ce3 Binary files /dev/null and b/product_import/static/description/icon.png differ diff --git a/product_import/static/description/index.html b/product_import/static/description/index.html new file mode 100644 index 000000000..b0de03295 --- /dev/null +++ b/product_import/static/description/index.html @@ -0,0 +1,1077 @@ + + + + + + Product Image from URL + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ Product Images from Web URLs and Local Paths. +

+

Product Image from URL +

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

Key + Highlights

+
+
+
+
+ +
+
+ Effortlessly Load a Product Image by Simply Pasting a URL or a Local Path in the Designated Field. +
+

You can Utilize Image URLs and Paths During the Product Import Process as well. +

+
+
+
+
+
+ +
+
+ Import Product from Products and Product Image by Adding URL or Path. +
+

Menu Item for Importing Product as XLSX or CSV and Add Image by URL or Local Path. +

+
+
+
+
+ +
+
+
+ Product Image from URL +

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

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

+ Paste URL of the Image in the Product Form. + +

+
+
+

+

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

+ The Image will Update Once the Record is Saved. + + +

+
+
+

+

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

+ + Menu Item for Importing Product. + +

+
+
+

+

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

+ + Select the File and Type of File for Importing Products + +

+
+
+

+

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

+ + You have the Option to Use URL or a Path for Importing Images. + +

+
+
+

The Fields in the File must be in this Format for CSV Importing. +

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

+ + The Product Details Along with the Images will be Imported. + +

+
+
+

+

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

+ + The Fields in the File must be in this Format for XLSX Importing. + +

+
+
+

+

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

+ + The Product Details Along with the Images will be Imported. + +

+
+
+

+

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

+ Load an Image in the Product Directly from the Product View Using a URL or Path. +

+
+
+

+

+
+
+
+
+
+
+
+ +
+

+ Import Products and Product Images by Adding URLs or Paths.

+
+
+

+

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

+ Internal users can + enable the 'Is + Indexed' checkbox to + specify whether a + product page should + be indexed by Google +

+
+
+ +
+ +
+

+ Yes, this module + allows setting + indexing preferences + at the product + level, giving + granular control + over how each + product appears in + search results. +

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

+ Latest Release 18.0.1.0.0 +

+ + 04th February, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • +
+
+
+
+
+
+
+
+
+
+ + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/product_import/views/product_product_views.xml b/product_import/views/product_product_views.xml new file mode 100644 index 000000000..246e7d6bd --- /dev/null +++ b/product_import/views/product_product_views.xml @@ -0,0 +1,14 @@ + + + + + product.normal.form.view.inherit.product.import + product.product + + + + + + + + diff --git a/product_import/views/product_template_views.xml b/product_import/views/product_template_views.xml new file mode 100644 index 000000000..45cb92ad8 --- /dev/null +++ b/product_import/views/product_template_views.xml @@ -0,0 +1,14 @@ + + + + + product.template.only.form.view.inherit.product.import + product.template + + + + + + + + diff --git a/product_import/wizard/__init__.py b/product_import/wizard/__init__.py new file mode 100644 index 000000000..c3f5996fc --- /dev/null +++ b/product_import/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sreerag PM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import product_import diff --git a/product_import/wizard/product_import.py b/product_import/wizard/product_import.py new file mode 100644 index 000000000..ae15153db --- /dev/null +++ b/product_import/wizard/product_import.py @@ -0,0 +1,158 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Sreerag PM (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import tempfile +import binascii +import base64 +import certifi +import urllib3 +import xlrd +from odoo.exceptions import UserError +from odoo import fields, models, _ + + +class ProductImport(models.Model): + """ Import Product data """ + _name = 'product.import' + _description = 'Product Import' + + file = fields.Binary(string="Upload File", help="Choose the file to upload") + file_name = fields.Char(string="File Name", help="Name of the file") + option = fields.Selection([ + ('csv', 'CSV'), + ('xlsx', 'XLSX')], default='csv', help="Choose the file type") + + def import_file(self): + """ Function to import product details from csv or xlsx file """ + if self.option == 'csv': + try: + product_temp_data = self.env['product.template'].search([]) + file = base64.b64decode(self.file) + file_string = file.decode('utf-8') + file_string = file_string.split('\n') + http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', + ca_certs=certifi.where()) + except: + raise UserError(_("Please choose the correct file!")) + firstline = True + for file_item in file_string: + if firstline: + firstline = False + continue + product_temp = self.env['product.template'].search( + [('name', '=', file_item.split(",")[0])], limit=0) + if not product_temp.id: + if file_item.split(",")[0]: + if ("http://" in file_item.split(",")[4] or "https://" + in file_item.split(",")[4]): + link = file_item.split(",")[4] + image_response = http.request('GET', link) + image_thumbnail = base64.b64encode( + image_response.data) + product_name = { + 'name': file_item.split(",")[0], + 'type': file_item.split(",")[1], + 'barcode': file_item.split(",")[2], + 'list_price': file_item.split(",")[3], + 'image_1920': image_thumbnail, + } + product_temp_data.create(product_name) + elif '/home' in file_item.split(",")[4]: + with open(file_item.split(",")[4], 'rb') as file: + data = base64.b64encode(file.read()) + product_name = { + 'name': file_item.split(",")[0], + 'type': file_item.split(",")[1], + 'barcode': file_item.split(",")[2], + 'list_price': file_item.split(",")[3], + 'image_1920': data, + } + product_temp_data.create(product_name) + else: + product_name = { + 'name': file_item.split(",")[0], + 'type': file_item.split(",")[1], + 'barcode': file_item.split(",")[2], + 'list_price': file_item.split(",")[3], + } + product_temp_data.create(product_name) + else: + raise UserError(_("Add the product which is not available" + "in products")) + if self.option == 'xlsx': + try: + product_temp_data = self.env['product.template'].search([]) + file_string = tempfile.NamedTemporaryFile(suffix=".xlsx") + file_string.write(binascii.a2b_base64(self.file)) + book = xlrd.open_workbook(file_string.name) + sheet = book.sheet_by_index(0) + http = urllib3.PoolManager(cert_reqs='CERT_REQUIRED', + ca_certs=certifi.where()) + except: + raise UserError(_("Please choose the correct file")) + startline = True + for i in range(sheet.nrows): + if startline: + startline = False + else: + line = list(sheet.row_values(i)) + product_temp = self.env['product.template'].search( + [('name', '=', line[0])], limit=0) + if not product_temp.id: + if line[0]: + if "http://" in line[4] or "https://" in line[4]: + link = line[4] + image_response = http.request('GET', link) + image_thumbnail = base64.b64encode( + image_response.data) + product_name = { + 'name': line[0], + 'type': line[1], + 'barcode': line[2], + 'list_price': line[3], + 'image_1920': image_thumbnail, + } + product_temp_data.create( + product_name) + elif "/home" in line[4]: + with open(line[4], 'rb') as file: + data = base64.b64encode(file.read()) + product_name = { + 'name': line[0], + 'type': line[1], + 'barcode': line[2], + 'list_price': line[3], + 'image_1920': data, + } + product_temp_data.create( + product_name) + else: + product_name = { + 'name': line[0], + 'type': line[1], + 'barcode': line[2], + 'list_price': line[3], + } + product_temp_data.create( + product_name) + else: + raise UserError(_( + "Add the product which not available in products")) diff --git a/product_import/wizard/product_import_views.xml b/product_import/wizard/product_import_views.xml new file mode 100644 index 000000000..44ddaa13e --- /dev/null +++ b/product_import/wizard/product_import_views.xml @@ -0,0 +1,37 @@ + + + + + import.product.view.form + product.import + +
+ + + + +
+
+
+
+
+ + + Import Product + product.import + ir.actions.act_window + list,form + + {} + new + + + +