From 1f1a0ef14b9632847b909485265417b8c6f5fc0f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 4 Sep 2012 14:18:23 +0200 Subject: [PATCH] [IMP] cancel pending edition when hiding the list view, if editable otherwise the edition disappears but part of the list view (e.g. buttons at the top) remain in the wrong state bzr revid: xmo@openerp.com-20120904121823-kejzzquax2hdedoo --- addons/web/static/src/js/view_list_editable.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 4ea46c51e07..bdd266454dd 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -55,6 +55,12 @@ openerp.web.list_editable = function (instance) { instance.web.bus.off('resize', this, this.resize_fields); this._super(); }, + do_hide: function () { + if (this.editor.is_editing()) { + this.cancel_edition(true); + } + this._super(); + }, /** * Handles the activation of a record in editable mode (making a record * editable), called *after* the record has become editable.