From b55e29ea86ee8a7d2f3e12234af0f41cfcd00e4e Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 27 Jan 2016 09:47:11 +0100 Subject: [PATCH] [FIX] web: improve focus/blur one2many dataset The dataset of an x2m could be set as changed on a focus event, but if the form is currently not in editing, it could stay blocked in this state. This commit add a check so blur and focus on x2m are better coupled. opw-665401 --- addons/web/static/src/js/views/form_relational_widgets.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js index c2e363c7777..3f39b45de78 100644 --- a/addons/web/static/src/js/views/form_relational_widgets.js +++ b/addons/web/static/src/js/views/form_relational_widgets.js @@ -1159,6 +1159,9 @@ var One2ManyListView = X2ManyListView.extend({ return this._super(); }, _on_focus_one2many: function () { + if(!this.editor.is_editing()) { + return; + } this.dataset.x2m.internal_dataset_changed = true; this._dataset_changed = false; this.__focus = true;