[FIX] conflict between form autoblur thing and focus management in editable o2m

bzr revid: xmo@openerp.com-20120807072650-ia0u56u8z20tgbfw
This commit is contained in:
Xavier Morel 2012-08-07 09:26:50 +02:00
parent d8e2bec158
commit d9291d50c8
1 changed files with 7 additions and 0 deletions

View File

@ -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);
},