From b229e9cb8c1fdc83a1aa5abd51141e32aea59bcd Mon Sep 17 00:00:00 2001 From: jpr-odoo Date: Fri, 10 Feb 2017 15:12:53 +0100 Subject: [PATCH] [FIX] web_editor: Show only image tab in media dialog if field type is 'image' Reproducible steps: Select an icon instead of a picture -> it breaks it up or a video, or a document. The tabs shouldn't be displayed at all. --- addons/web_editor/static/src/js/widgets.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index fcffc2f343b..cd6b5befb06 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -107,8 +107,7 @@ var MediaDialog = Dialog.extend({ }, start: function () { var self = this; - - this.only_images = this.options.only_images || this.options.select_images || (this.media && $(this.media).parent().data("oe-field") === "image"); + this.only_images = this.options.only_images || this.options.select_images || (this.media && ($(this.media).parent().data("oe-field") === "image" || $(this.media).parent().data("oe-type") === "image")); if (this.only_images) { this.$('[href="#editor-media-document"], [href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden'); }