From e515b04fc2eb3d2a822fded4cb06cc286db614e6 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Wed, 16 Apr 2025 12:42:34 +0530 Subject: [PATCH] APR 16: [FIX] Bug fixed 'product_export_with_images' --- .../controllers/product_export_with_images.py | 6 +++--- .../static/description/index.html | 19 +++++++++++++++++++ .../wizard/product_export.py | 1 - 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/product_export_with_images/controllers/product_export_with_images.py b/product_export_with_images/controllers/product_export_with_images.py index 299fa9f6a..29654e96c 100644 --- a/product_export_with_images/controllers/product_export_with_images.py +++ b/product_export_with_images/controllers/product_export_with_images.py @@ -29,7 +29,8 @@ from odoo.http import content_disposition, request from odoo.tools import image_process import subprocess import os - +import traceback +from tempfile import NamedTemporaryFile class ExcelReportController(http.Controller): @@ -51,6 +52,7 @@ class ExcelReportController(http.Controller): ("Content-Disposition", content_disposition("Products" + ".xlsx")), ], ) + # Create workbook object from xlsxwriter library output = io.BytesIO() workbook = xlsxwriter.Workbook(output, {"in_memory": True}) header_style = workbook.add_format( @@ -122,7 +124,6 @@ class ExcelReportController(http.Controller): sheet.insert_image(row, 6, "product." + image_type, {"image_data": image_data}) elif image_type == "webp": try: - from tempfile import NamedTemporaryFile with NamedTemporaryFile(suffix='.webp', delete=False) as temp_in: temp_in.write(source) @@ -150,7 +151,6 @@ class ExcelReportController(http.Controller): sheet.insert_image(row, 6, "product.png", {"image_data": image_data}) except Exception as e: - import traceback traceback.print_exc() row += 1 number += 1 diff --git a/product_export_with_images/static/description/index.html b/product_export_with_images/static/description/index.html index ccc9fe55d..eda08b661 100644 --- a/product_export_with_images/static/description/index.html +++ b/product_export_with_images/static/description/index.html @@ -201,6 +201,25 @@ +
+
+
+ +
+ This module requires an external system dependency. Please install the WebP library using the appropriate method for your operating system +
+ Ubuntu/Debian: sudo apt-get install webp + macOS: brew install webp + Windows: Download from: https://developers.google.com/speed/webp/download +
+
+
+
+