[168] data_nature_importer: Add image mime type check

This commit is contained in:
Niels Göttsch 2026-01-28 08:50:54 +01:00 committed by madmooose
parent 4bd2084593
commit 0c62fc4de0
5 changed files with 10 additions and 2 deletions

View file

@ -43,6 +43,7 @@ Changelog
- 16.0.1.1.0: Add Queue Job support and move to server action - 16.0.1.1.0: Add Queue Job support and move to server action
- 16.0.1.1.1: Use default image as product image - 16.0.1.1.1: Use default image as product image
- 16.0.1.2.0: Add Extra Product Media support - 16.0.1.2.0: Add Extra Product Media support
- 16.0.1.2.1: Add image mime type check
Bug Tracker Bug Tracker
=========== ===========

View file

@ -4,7 +4,7 @@
"author": "BAKEUP", "author": "BAKEUP",
"website": "https://www.bakeup.org", "website": "https://www.bakeup.org",
"category": "product", "category": "product",
"version": "16.0.1.2.0", "version": "16.0.1.2.1",
"depends": ["product", "queue_job", "website_sale"], "depends": ["product", "queue_job", "website_sale"],
"data": [ "data": [
"security/ir.model.access.csv", "security/ir.model.access.csv",

View file

@ -30,6 +30,11 @@ class ProductTemplate(models.Model):
image_id = None image_id = None
for image in images: for image in images:
image_id = image.get("id") image_id = image.get("id")
if image.get("mime_type") not in [
"image/jpeg",
"image/png",
]:
continue
image_data = dn_utils.get_datanature_image(self, image_id, token=None) image_data = dn_utils.get_datanature_image(self, image_id, token=None)
if not image_data: if not image_data:
continue continue

View file

@ -3,3 +3,4 @@
- 16.0.1.1.0: Add Queue Job support and move to server action - 16.0.1.1.0: Add Queue Job support and move to server action
- 16.0.1.1.1: Use default image as product image - 16.0.1.1.1: Use default image as product image
- 16.0.1.2.0: Add Extra Product Media support - 16.0.1.2.0: Add Extra Product Media support
- 16.0.1.2.1: Add image mime type check

View file

@ -386,6 +386,7 @@ ul.auto-toc {
<li>16.0.1.1.0: Add Queue Job support and move to server action</li> <li>16.0.1.1.0: Add Queue Job support and move to server action</li>
<li>16.0.1.1.1: Use default image as product image</li> <li>16.0.1.1.1: Use default image as product image</li>
<li>16.0.1.2.0: Add Extra Product Media support</li> <li>16.0.1.2.0: Add Extra Product Media support</li>
<li>16.0.1.2.1: Add image mime type check</li>
</ul> </ul>
</div> </div>
<div class="section" id="bug-tracker"> <div class="section" id="bug-tracker">