diff --git a/import_product_image/models/import_image.py b/import_product_image/models/import_image.py index 478d4ad50..a119cbf3f 100644 --- a/import_product_image/models/import_image.py +++ b/import_product_image/models/import_image.py @@ -61,11 +61,10 @@ class ProductImageImportWizard(models.TransientModel): 'image_medium': image_base64, 'name': product, } - if self.pdt_operation == '1': - if not product_id: - product_obj.create(vals) - else: - product_id.write(vals) + 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': @@ -85,15 +84,15 @@ class ProductImageImportWizard(models.TransientModel): 'image_medium': image_base64, 'name': product, } - if self.pdt_operation == '1': - if not product_id: - product_obj.create(vals) - else: - product_id.write(vals) + 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) + 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/index.html b/import_product_image/static/description/index.html index 6f4a09760..cf996baa7 100644 --- a/import_product_image/static/description/index.html +++ b/import_product_image/static/description/index.html @@ -57,6 +57,22 @@
+
+
+

+

Imported Product Images

+

+

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

diff --git a/import_product_image/static/description/product.png b/import_product_image/static/description/product.png new file mode 100644 index 000000000..04807c7c8 Binary files /dev/null and b/import_product_image/static/description/product.png differ