From b19f2f9166b601ba10893eb4e2c2e5046c47f0bb Mon Sep 17 00:00:00 2001 From: abd-msyukyu-odoo Date: Thu, 29 Jun 2023 17:52:49 +0000 Subject: [PATCH] [IMP] web_editor: render templates insertion collaborative-friendly In Knowledge, there is a custom `KnowledgeHtmlField` which adds a menu placeholder if the `HtmlField` value is empty. It evaluates if it is empty after each `historyStep`. This commit introduces new collaborative step events so that the `KnowledgeHtmlField` is able to properly hide/show that menu even after a collaborator made the value empty. task-3378266 X-original-commit: odoo/odoo@b6f103bd3e2345cbd44254714489a989ad5a72ed Part-of: odoo/odoo#128962 --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 13402f31a4d..31e17f2b18b 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -1160,6 +1160,7 @@ export class OdooEditor extends EventTarget { this._handleCommandHint(); this.multiselectionRefresh(); this.observerActive(); + this.dispatchEvent(new Event('historyResetFromSteps')); } historyGetMissingSteps({fromStepId, toStepId}) { const fromIndex = this._historySteps.findIndex(x => x.id === fromStepId); @@ -1661,6 +1662,7 @@ export class OdooEditor extends EventTarget { this.historyResetLatestComputedSelection(); this._handleCommandHint(); this.multiselectionRefresh(); + this.dispatchEvent(new Event('onExternalHistorySteps')); } // Multi selection