From 3ae8aa3333994d8222e865cc5a4297913b98de8d Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 19 Nov 2021 21:01:08 +0100 Subject: [PATCH] [FIX] web_pwa_oca: Guess properly mimetype It seems since https://github.com/odoo/odoo/commit/3bd0327d6d1734736986bef543349a69af3e2414 that the mimetype detection is not working properly for not fully compliant SVG. Let's resave SVG for having a compatible one + add a pointer when the mimetype doesn't conform. --- web_pwa_oca/models/res_config_settings.py | 5 +- web_pwa_oca/static/img/icons/odoo_logo.svg | 68 +++++++++++++++++++++- 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/web_pwa_oca/models/res_config_settings.py b/web_pwa_oca/models/res_config_settings.py index 5e22c42df..229c55b4c 100644 --- a/web_pwa_oca/models/res_config_settings.py +++ b/web_pwa_oca/models/res_config_settings.py @@ -128,7 +128,10 @@ class ResConfigSettings(models.TransientModel): if not pwa_icon_mimetype.startswith( "image/svg" ) and not pwa_icon_mimetype.startswith("image/png"): - raise exceptions.UserError(_("You can only upload SVG or PNG files")) + raise exceptions.UserError( + _("You can only upload SVG or PNG files. Found: %s.") + % pwa_icon_mimetype + ) # Delete all previous records if we are writting new ones if pwa_icon_ir_attachments: pwa_icon_ir_attachments.unlink() diff --git a/web_pwa_oca/static/img/icons/odoo_logo.svg b/web_pwa_oca/static/img/icons/odoo_logo.svg index 979e1e254..8a705eaf5 100644 --- a/web_pwa_oca/static/img/icons/odoo_logo.svg +++ b/web_pwa_oca/static/img/icons/odoo_logo.svg @@ -1 +1,67 @@ - + + + + + + image/svg+xml + + + + + + + + + + + +