From 6aa487ecd8831980e8b7bfc219aafeb9a51eb9bd Mon Sep 17 00:00:00 2001 From: shsa-odoo Date: Thu, 8 Feb 2024 14:32:15 +0530 Subject: [PATCH] [FIX] web_editor: do not display ai option for media MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Specification: This commit target the scenario when image is in selection and the toolbar displays AI option for it, which made no sense as the generated response will replace the image. After this commit: The toolbar has been updated to show AI option only for text based scenario task-3733320 closes odoo/odoo#153190 Signed-off-by: Geelen Sébastien (sge) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 49b497114c7..081c8782816 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -2161,6 +2161,7 @@ export class Wysiwyg extends Component { '#list', '#colorInputButtonGroup', '#media-insert', // "Insert media" should be replaced with "Replace media". + '#chatgpt', // Chatgpt should be removed when media is in selection. ].join(','))){ el.classList.toggle('d-none', isInMedia); }