From 126a09cc4223f5ce6f54b731232f7e4d48b70dfb Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Tue, 2 Mar 2021 12:42:39 +0000 Subject: [PATCH] [FIX] web_editor: fix media-dialog not showing most images This was caused by trying to not show dynamic-svgs that had already been downloaded when the option to not allow the media-library was activated (eg in the website logo, we do not want to allow dynamic SVGs) Unfortunately the domain was doing a string comparison to make sure the url wasn't like the one from dynamic SVGs but implicitly required that the url field be not null. This commit fixes that by explicitly allowing images with a null url field. task-2466819 part of odoo/odoo#66732 closes odoo/odoo#67411 X-original-commit: 0784e14dd39817720e6fc70c2b41ea3bbad5843a Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/wysiwyg/widgets/media.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js index 27397e9c8a2..8f7c6992450 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js @@ -295,7 +295,7 @@ var FileWidget = SearchableMediaWidget.extend({ domain.push(['name', 'ilike', needle]); } if (!this.options.useMediaLibrary) { - domain.push('!', ['url', '=ilike', '/web_editor/shape/%']); + domain.push('|', ['url', '=', false], '!', ['url', '=ilike', '/web_editor/shape/%']); } domain.push('!', ['name', '=like', '%.crop']); domain.push('|', ['type', '=', 'binary'], '!', ['url', '=like', '/%/static/%']);