summaryrefslogtreecommitdiff
path: root/addons/web_editor
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2021-03-02 12:42:39 +0000
committerqsm-odoo <qsm@odoo.com>2021-03-05 15:18:11 +0000
commit0784e14dd39817720e6fc70c2b41ea3bbad5843a (patch)
tree39b16c5524aa83e18238da2ff17d6e675f7f3788 /addons/web_editor
parent84417a174bc2bb76730cc89783d3426a3a3b07d9 (diff)
[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 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/widgets/media.js2
1 files changed, 1 insertions, 1 deletions
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 22fb54604b9..9c7402f9722 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/%']);