From b053277ee741c80da5b44463c5446d490a8e0e8a Mon Sep 17 00:00:00 2001 From: abd-msyukyu-odoo Date: Thu, 15 Jun 2023 12:29:17 +0000 Subject: [PATCH] [FIX] web_editor: fix FIELD_IS_DIRTY notification on historystep Fixes an issue introduced in a forward-port: https://github.com/odoo/odoo/commit/db0c092973f480f3336a44e5f6868dc5a79f0e3a The listener was not set on the correct target, `historyStep` event is triggered on `odooEditor` and not `odooEditor.editable`. This meant that the FormStatusIndicator was not properly notified and the `save/discard` button was not visible after an editor `historyStep` on form views task-3373603 closes odoo/odoo#126006 X-original-commit: f76585530d7387ff2f44639252829aa4546cea1b Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/backend/html_field.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index 319013c3194..402dbdfa6b0 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -337,7 +337,7 @@ export class HtmlField extends Component { this.wysiwyg.toolbar.$el.append($codeviewButtonToolbar); $codeviewButtonToolbar.click(this.toggleCodeView.bind(this)); } - this.wysiwyg.odooEditor.editable.addEventListener("historyStep", () => + this.wysiwyg.odooEditor.addEventListener("historyStep", () => this.props.record.model.bus.trigger("FIELD_IS_DIRTY", this._isDirty()) );