summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorfja-odoo <fja@odoo.com>2019-05-21 16:49:48 +0000
committerqsm-odoo <qsm@odoo.com>2019-07-30 09:03:51 +0000
commitbb370776100faf43b0afe2c11178662482c52223 (patch)
treee8be7137a7061759a3c28424a2f5f3387cb0a4cf /addons/web_editor/static/src
parentd14093dcb7fc67b9653b9b14b0b4c92a3bdd1c74 (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_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/widgets/media.js8
1 files changed, 8 insertions, 0 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 b196552709d..e116ab77e49 100644
--- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
+++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
@@ -821,6 +821,14 @@ var DocumentWidget = FileWidget.extend({
this.$addUrlButton.text((isURL && isImage) ? _t("Add as image") : _t("Add document"));
this.$urlWarning.toggleClass('d-none', !isURL || !isImage);
},
+ /**
+ * @override
+ */
+ _getAttachmentsDomain: function (needle) {
+ var domain = this._super.apply(this, arguments);
+ // the assets should not be part of the documents
+ return domain.concat('!', utils.assetsDomain());
+ },
});
/**