From 1bbb7c920b3cadefe1af893a53809365186fdc8f Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Thu, 18 Nov 2021 09:21:33 +0000 Subject: [PATCH] [FIX] website: fix menu item edition from "edit link" button When changing the label of a navbar menu via the link popover "edit link" button and the menu edition dialog, the label would not be changed after saving. Reloading the page would display the updated label. While the RPC was correctly made to update the website.menu, the editor would apply a historyRevert after the DOM update to change the menu label on the page. This change should not be recorded by the editor as a RPC to update the website.menu is executed at the same time. task-2513588 X-original-commit: 71ac6244037608cf529586b43946f992b723e7db Part-of: odoo/odoo#81351 --- addons/website/static/src/js/widgets/link_popover_widget.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/website/static/src/js/widgets/link_popover_widget.js b/addons/website/static/src/js/widgets/link_popover_widget.js index 426ca8f6c98..1bcc214734a 100644 --- a/addons/website/static/src/js/widgets/link_popover_widget.js +++ b/addons/website/static/src/js/widgets/link_popover_widget.js @@ -75,8 +75,10 @@ const NavbarLinkPopoverWidget = weWidgets.LinkPopoverWidget.extend({ method: 'save', args: [websiteId, {'data': [data]}], }).then(function () { + self.options.wysiwyg.odooEditor.observerUnactive(); self.$target.attr('href', link.url); $menu.text(link.content); + self.options.wysiwyg.odooEditor.observerActive(); }); }); dialog.open();