[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) <qsm@odoo.com>
This commit is contained in:
Samuel Degueldre
2021-03-05 18:39:01 +00:00
committed by qsm-odoo
parent 6c7476f5df
commit 126a09cc42
@@ -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/%']);