From 9d40ec7d15898ee9f3d2a92c7264690586c35cd8 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 25 May 2020 14:41:42 +0000 Subject: [FIX] web: resquencing stop at first controller When a resequencing is done inside an object hierarchy of two controllers, since 9b90d8727d we would call resquencing code one time per controller. So if for example we are in a list view inside a form view (eg. a "Search More" modal in a form view) the resequencing would work for the list view, but then cause traceback when it is handled by form view. With this changeset, the first controller that get the event `resequence_records` even gobbles it up. Without change, added test fails because of original traceback: Cannot read property 'res_id' of undefined@ 202 ms Source: TypeError: Cannot read property 'res_id' of undefined at /web/static/src/js/views/basic/basic_controller.js:744:67 ... opw-2256818 closes #51827 closes odoo/odoo#52018 X-original-commit: eef4b99fdb9469c040af80d055933eda367b7b3d Signed-off-by: Nicolas Lempereur (nle) --- addons/web/static/src/js/views/basic/basic_controller.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js/views/basic') diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index f652820e814..6434554d376 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -749,6 +749,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { * @param {string} ev.data.handleField */ _onResequenceRecords: function (ev) { + ev.stopPropagation(); // prevent other controllers from handling this request this.trigger_up('mutexify', { action: async () => { let state = this.model.get(this.handle); -- cgit v1.2.3