summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-02-17 12:49:28 +0000
committerSamuel Degueldre <sad@odoo.com>2020-03-04 14:31:06 +0000
commit4e14151465f731c4b2b51efd7bb0c1f0466b0c71 (patch)
tree737d7ae12350b32ecbbdeb7f2d661681556ef73a /addons/web_editor/static/src/js/editor
parent67868583ac282a538b7029e1e646b2d6813856dd (diff)
[FIX] web_editor: stop media-dialog from loading all db attachments
Before this commit, the media-dialog was reading all attachments that matched certain criteria for each tab. On large databases, this results in the search_read call timing out, preventing the media-dialog from opening and making all images and documents un-editable. One unfortunate consequence of this is that we can no longer use the firstFilter and lastFilter features, as those rely on fetching all records and sorting them client-side, as such, this feature has been removed entirely. task-2198527 closes https://github.com/odoo/odoo/issues/43113 closes odoo/odoo#46895 X-original-commit: 1e91a89b78ff6019c6120c73ea1eab09b3d58d2f Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js1
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js2
2 files changed, 0 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js
index 8a848389c51..0ea828d5589 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -421,7 +421,6 @@ eventHandler.modules.imageDialog.showImageDialog = function ($editable) {
$editable: $editable,
media: media,
options: {
- lastFilters: ['background'],
onUpload: $editable.data('callbacks').onUpload,
noVideos:
$editable.data('oe-model') === "mail.compose.message" ||
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js
index 11f54264f20..f3ded8c57a2 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -1133,7 +1133,6 @@ const ImagepickerUserValueWidget = UserValueWidget.extend({
start: async function () {
await this._super(...arguments);
const allowedSelector = this.el.dataset.allowVideos;
- this.firstFilters = (this.el.dataset.firstFilters || '').split(',').filter(s => s !== '');
this.allowVideos = allowedSelector ? this.$target.is(allowedSelector) : false;
this.editImageButton = document.createElement('we-button');
@@ -1190,7 +1189,6 @@ const ImagepickerUserValueWidget = UserValueWidget.extend({
isForBgVideo: true,
res_model: $editable.data('oe-model'),
res_id: $editable.data('oe-id'),
- firstFilters: this.firstFilters,
}, dummyEl).open();
mediaDialog.on('save', this, data => {
if (data.bgVideoSrc) {