From d9291d50c817f0eeb6210909322b241d21b3484e Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 7 Aug 2012 09:26:50 +0200 Subject: [PATCH] [FIX] conflict between form autoblur thing and focus management in editable o2m bzr revid: xmo@openerp.com-20120807072650-ia0u56u8z20tgbfw --- addons/web/static/src/js/view_form.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index cc92244ce81..7549dffa961 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3338,6 +3338,7 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ ListType: instance.web.form.One2ManyList })); this.on('edit:before', this, this.proxy('_before_edit')); + this.on('edit:after', this, this.proxy('_after_edit')); this.on('save:before cancel:before', this, this.proxy('_before_unedit')); this.records @@ -3448,6 +3449,12 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ this.__ignore_blur = false; this.editor.form.on('blurred', this, this._on_form_blur); }, + _after_edit: function () { + // The form's blur thing may be jiggered during the edition setup, + // potentially leading to the o2m instasaving the row. Cancel any + // blurring triggered the edition startup here + this.editor.form.widgetFocused(); + }, _before_unedit: function () { this.editor.form.off('blurred', this, this._on_form_blur); },