diff --git a/addons/web/static/src/legacy/js/core/utils.js b/addons/web/static/src/legacy/js/core/utils.js index 94e9a25a85b..7e04354e90e 100644 --- a/addons/web/static/src/legacy/js/core/utils.js +++ b/addons/web/static/src/legacy/js/core/utils.js @@ -1129,24 +1129,6 @@ var utils = Object.assign({ } return curr; }, - /** - * Returns the domain targeting assets files. - * - * @returns {Array} Domain of assets files - */ - assetsDomain: function () { - return [ - '&', - ['res_model', '=', 'ir.ui.view'], - '|', - '|', - '|', - ['name', '=like', '%.assets\_%.css'], - ['name', '=like', '%.assets\_%.js'], - ['name', '=like', '%.report_assets\_%.css'], - ['name', '=like', '%.assets\_%.map'], - ]; - }, }, cookieUtils); return utils; 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 76a7ecbb15a..3cac0191254 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js @@ -1069,8 +1069,9 @@ var DocumentWidget = FileWidget.extend({ */ _getAttachmentsDomain: function (needle) { var domain = this._super.apply(this, arguments); - // the assets should not be part of the documents - return domain.concat('!', utils.assetsDomain()); + // The assets should not be part of the documents. + // All assets begin with '/web/assets/', see _get_asset_template_url(). + return ['&', '|', ['url', '=', null], '!', ['url', '=like', '/web/assets/%']].concat(domain); }, });