From d1292a96a62b18a88a852c69ed7732d16ae0344e Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Mon, 28 Feb 2022 11:12:29 +0000 Subject: [PATCH] [IMP] base,*: support image/webp image format *: mail, mrp, test_website, web, web_editor Before this commit '.webp' images could not be used in odoo. After this commit '.webp' images can be uploaded to odoo. - can be used in image field - can be used in HTML field image - can be used in mails and website - can be transformed (shape mask, filter effect, crop, rotate, resize, adjust quality) task-2774352 Part-of: odoo/odoo#85494 --- .../mail/static/src/core/common/attachment_model.js | 1 + addons/mail/views/mail_message_views.xml | 2 +- addons/mrp/views/ir_attachment_view.xml | 2 +- .../static/tests/tours/image_upload_progress.js | 4 ++-- .../web/static/src/legacy/js/public/public_root.js | 2 +- addons/web_editor/models/ir_attachment.py | 1 + .../src/components/media_dialog/file_selector.js | 4 ++-- .../static/src/js/editor/image_processing.js | 2 +- .../src/js/editor/odoo-editor/src/OdooEditor.js | 2 +- .../static/src/js/editor/snippets.options.js | 2 +- .../src/js/wysiwyg/widgets/image_crop_widget.js | 5 ++++- odoo/addons/base/tests/test_mimetypes.py | 10 ++++++++++ odoo/http.py | 1 + odoo/tools/image.py | 13 +++++++++---- odoo/tools/mimetypes.py | 7 +++++++ 15 files changed, 43 insertions(+), 15 deletions(-) diff --git a/addons/mail/static/src/core/common/attachment_model.js b/addons/mail/static/src/core/common/attachment_model.js index 98b2f93dc50..3c8a730e0ee 100644 --- a/addons/mail/static/src/core/common/attachment_model.js +++ b/addons/mail/static/src/core/common/attachment_model.js @@ -62,6 +62,7 @@ export class Attachment { "image/svg+xml", "image/tiff", "image/x-icon", + "image/webp", ]; return imageMimetypes.includes(this.mimetype); } diff --git a/addons/mail/views/mail_message_views.xml b/addons/mail/views/mail_message_views.xml index 64e2a3c9185..07bba18d363 100644 --- a/addons/mail/views/mail_message_views.xml +++ b/addons/mail/views/mail_message_views.xml @@ -152,7 +152,7 @@
- +