diff --git a/.travis.yml b/.travis.yml index 921c6137b..2991299ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ virtualenv: before_install: - pip install codecov coverage - pip install httpagentparser - - pip install urllib + install: diff --git a/import_product_image/README.rst b/import_product_image/README.rst deleted file mode 100644 index 6410de68f..000000000 --- a/import_product_image/README.rst +++ /dev/null @@ -1,51 +0,0 @@ -Import Product Image v11 -======================== - -This Cybrosys's module allows you to import images for a product/product variant from a -CSV file using URL and file path. You can also create a new product from the wizard -if it does not exist in the system. - -Installation -============ -- www.odoo.com/documentation/11.0/setup/install.html -- Install our custom addon - -Features -======== - -* Import Product Image From CSV File(Url/ File Path). - -Technical Notes -=============== - -Used Libraries: - -* urllib2 -* requests -* urllib2 -* base64 - -License -======= -GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) -(http://www.gnu.org/licenses/agpl.html) - -Bug Tracker -=========== -Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. - -Credits -======= -* Cybrosys Techno Solutions - -Author ------- - -Developer: Saritha @ cybrosys, saritha@cybrosys.in - -Maintainer ----------- - -This module is maintained by Cybrosys Technologies. - -For support and more information, please visit https://www.cybrosys.com. diff --git a/import_product_image/__init__.py b/import_product_image/__init__.py deleted file mode 100644 index 9206ddbc4..000000000 --- a/import_product_image/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################### -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Saritha Sahadevan () -# -# This program is free software: you can modify -# it under the terms of the GNU Affero General Public License (AGPL) as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -################################################################################### -from . import models diff --git a/import_product_image/__manifest__.py b/import_product_image/__manifest__.py deleted file mode 100644 index 7eb6b296b..000000000 --- a/import_product_image/__manifest__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################### -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Saritha Sahadevan () -# -# This program is free software: you can modify -# it under the terms of the GNU Affero General Public License (AGPL) as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -################################################################################### -{ - 'name': "Import Product Image", - 'version': '11.0.1.0.0', - 'summary': """Import Product Image from CSV File""", - 'description': """Import Product Image from CSV File(Web URL/File Path)""", - 'author': "Cybrosys Techno Solutions", - 'company': 'Cybrosys Techno Solutions', - 'maintainer': 'Cybrosys Techno Solutions', - 'website': "https://www.cybrosys.com", - 'category': 'Sales', - 'depends': ['sale'], - 'data': ['views/import_product_image_view.xml'], - 'license': 'AGPL-3', - 'images': ['static/description/banner.jpg'], - 'application': False, - 'installable': True, - 'auto_install': False, -} diff --git a/import_product_image/models/__init__.py b/import_product_image/models/__init__.py deleted file mode 100644 index 0764e94d1..000000000 --- a/import_product_image/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import import_image diff --git a/import_product_image/models/import_image.py b/import_product_image/models/import_image.py deleted file mode 100644 index a8c8aa299..000000000 --- a/import_product_image/models/import_image.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################### -# -# Cybrosys Technologies Pvt. Ltd. -# Copyright (C) 2017-TODAY Cybrosys Technologies(). -# Author: Saritha Sahadevan () -# -# This program is free software: you can modify -# it under the terms of the GNU Affero General Public License (AGPL) as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -################################################################################### -import csv -import urllib -import base64 -import StringIO -import sys -from odoo import models, fields, api -from odoo.exceptions import Warning - - -class ProductImageImportWizard(models.TransientModel): - _name = 'import.product_image' - - product_model = fields.Selection([('1', 'Product Template'), ('2', 'Product Variants')], string="Product Model") - pdt_operation = fields.Selection([('1', 'Product Creation'), ('2', 'Product Updation')], string="Product Operation") - file = fields.Binary('File to import', required=True) - - @api.multi - def import_file(self): - file = StringIO.StringIO(base64.decodestring(self.file)) - reader = csv.reader(file, delimiter=',') - csv.field_size_limit(sys.maxsize) - skip_header = True - for row in reader: - if skip_header: - skip_header = False - continue - product = row[0] - image_path = row[1] - if "http://" in image_path or "https://" in image_path: - try: - link = urllib.urlopen(image_path).read() - image_base64 = base64.encodestring(link) - if self.product_model == '1': - product_obj = self.env['product.template'] - else: - product_obj = self.env['product.product'] - product_id = product_obj.search([('name', '=', product)]) - - vals = { - 'image_medium': image_base64, - 'name': product, - } - if self.pdt_operation == '1' and not product_id: - product_obj.create(vals) - elif self.pdt_operation == '1' and product_id: - product_id.write(vals) - elif self.pdt_operation == '2' and product_id: - product_id.write(vals) - elif not product_id and self.pdt_operation == '2': - raise Warning("Could not find the product '%s'" % product) - except: - raise Warning("Please provide correct URL for product '%s' or check your image size.!" % product) - else: - try: - with open(image_path, 'rb') as image: - image_base64 = image.read().encode("base64") - if self.product_model == '1': - product_obj = self.env['product.template'] - else: - product_obj = self.env['product.product'] - product_id = product_obj.search([('name', '=', product)]) - vals = { - 'image_medium': image_base64, - 'name': product, - } - if self.pdt_operation == '1' and not product_id: - product_obj.create(vals) - elif self.pdt_operation == '1' and product_id: - product_id.write(vals) - elif self.pdt_operation == '2' and product_id: - product_id.write(vals) - elif not product_id and self.pdt_operation == '2': - raise Warning("Could not find the product '%s'" % product) - except IOError: - raise Warning("Could not find the image '%s' - please make sure it is accessible to this script" % - product) - diff --git a/import_product_image/static/description/banner.jpg b/import_product_image/static/description/banner.jpg deleted file mode 100644 index f474c18cd..000000000 Binary files a/import_product_image/static/description/banner.jpg and /dev/null differ diff --git a/import_product_image/static/description/csv_file.png b/import_product_image/static/description/csv_file.png deleted file mode 100644 index 127b08e6f..000000000 Binary files a/import_product_image/static/description/csv_file.png and /dev/null differ diff --git a/import_product_image/static/description/cybro_logo.png b/import_product_image/static/description/cybro_logo.png deleted file mode 100644 index bb309114c..000000000 Binary files a/import_product_image/static/description/cybro_logo.png and /dev/null differ diff --git a/import_product_image/static/description/icon.png b/import_product_image/static/description/icon.png deleted file mode 100644 index 7b3763019..000000000 Binary files a/import_product_image/static/description/icon.png and /dev/null differ diff --git a/import_product_image/static/description/import_product.png b/import_product_image/static/description/import_product.png deleted file mode 100644 index 05fb3715a..000000000 Binary files a/import_product_image/static/description/import_product.png and /dev/null differ diff --git a/import_product_image/static/description/index.html b/import_product_image/static/description/index.html deleted file mode 100644 index 50f68cea3..000000000 --- a/import_product_image/static/description/index.html +++ /dev/null @@ -1,119 +0,0 @@ -
-
-

Import Product Image

-

-

Cybrosys Technologies

-
-
-
- Import Product Image From CSV File(Url/ File Path).
-
-
-
- -
-
-
-

Overview

-

- This module allows you to import images for a product/product variant from a - CSV file using URL and file path. You can also create a new product from the wizard - if it does not exist in the system. -

-
-
-
- -
-
-
-

-

Import Multiple Image Through CSV File

-

-

-
-
- -
- This is a sample CSV file to import product image -
-
-
- -
-
-
-

-

Import Image From Url Or File path

-

-

-
- Here you have the option to create a new product or to modify existing products -
- -
-
-
-
- -
-
-
-

-

Imported Product Images

-

-

-
- Here you can see all your product with imported images -
- -
-
-
-
- -
-
-
-

-

Warning Message for unsupported image address

-

-

-
- In case of video data url.
- In case of unsupported file format.
- In case of image size is too large.
-
-
-
- -
-
-
-
- -
-

Need Any Help?

- -
diff --git a/import_product_image/static/description/product.png b/import_product_image/static/description/product.png deleted file mode 100644 index 04807c7c8..000000000 Binary files a/import_product_image/static/description/product.png and /dev/null differ diff --git a/import_product_image/static/description/warning.png b/import_product_image/static/description/warning.png deleted file mode 100644 index 0fe08f4af..000000000 Binary files a/import_product_image/static/description/warning.png and /dev/null differ diff --git a/import_product_image/views/import_product_image_view.xml b/import_product_image/views/import_product_image_view.xml deleted file mode 100644 index 495ba8308..000000000 --- a/import_product_image/views/import_product_image_view.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - product.import.image.form - import.product_image - form - -
- - - - - - - - - -
-
-
-
-
- - - Import Product Image - ir.actions.act_window - import.product_image - form - form - new - - - -
-