diff options
| author | fja-odoo <fja@odoo.com> | 2019-05-21 16:49:48 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-07-30 09:03:51 +0000 |
| commit | bb370776100faf43b0afe2c11178662482c52223 (patch) | |
| tree | e8be7137a7061759a3c28424a2f5f3387cb0a4cf /addons/web/static | |
| parent | d14093dcb7fc67b9653b9b14b0b4c92a3bdd1c74 (diff) | |
[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
Diffstat (limited to 'addons/web/static')
| -rw-r--r-- | addons/web/static/src/js/core/utils.js | 13 | ||||
| -rw-r--r-- | addons/web/static/src/js/tools/debug_manager.js | 5 |
2 files changed, 13 insertions, 5 deletions
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; diff --git a/addons/web/static/src/js/tools/debug_manager.js b/addons/web/static/src/js/tools/debug_manager.js index db14dec2e36..3e2601b037f 100644 --- a/addons/web/static/src/js/tools/debug_manager.js +++ b/addons/web/static/src/js/tools/debug_manager.js @@ -88,10 +88,7 @@ var DebugManager = Widget.extend({ */ regenerateAssets: function () { var self = this; - var domain = [ - ['res_model', '=', 'ir.ui.view'], - ['name', 'like', 'assets_'] - ]; + var domain = utils.assetsDomain(); this._rpc({ model: 'ir.attachment', method: 'search', |
