From bb370776100faf43b0afe2c11178662482c52223 Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Tue, 21 May 2019 16:49:48 +0000 Subject: [IMP] web_editor, *: remove assets from documents * web "Document" tab in "Select a media" Dialog was displaying all the assets files. Now all files containing "assets_" are excluded from the "Document" tab. This is similar to the regenerateAssets function in debug_manager that deletes assets based on this criteria. For consistency the Assets Domain is now a utils.js function Part of https://github.com/odoo/odoo/pull/33195 task-1945874 --- addons/web/static/src/js/core/utils.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/core/utils.js') diff --git a/addons/web/static/src/js/core/utils.js b/addons/web/static/src/js/core/utils.js index bf312dfd905..bd9a8d1db64 100644 --- a/addons/web/static/src/js/core/utils.js +++ b/addons/web/static/src/js/core/utils.js @@ -771,7 +771,18 @@ var utils = { } 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_'] + ]; + }, }; return utils; -- cgit v1.2.3