From eac7e16e2008157fc797a3f5b996bda97efceb44 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 24 Mar 2017 16:34:37 +0100 Subject: [PATCH] [FIX] web: no formview dialog during editable list edition Clicking on an editable list row makes the row editable. Clicking on an editable list row while another row is being edited, first make the row being edited readonly before making the clicked row editable. The row which goes back to readonly have to be reloaded, operation which is not instantaneous. If another row is clicked while a row is going back to readonly (this typically happens if a row is double clicked while another one is being edited), a form view dialog was opened to edit the row (behavior which was not expected). opw-710627 --- addons/web/static/src/js/views/list_view_editable.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/web/static/src/js/views/list_view_editable.js b/addons/web/static/src/js/views/list_view_editable.js index c3b2209c477..6beb6a7a044 100644 --- a/addons/web/static/src/js/views/list_view_editable.js +++ b/addons/web/static/src/js/views/list_view_editable.js @@ -828,6 +828,10 @@ ListView.List.include(/** @lends instance.web.ListView.List# */{ if (!this.view.editable() || !this.view.is_action_enabled('edit')) { return this._super.apply(this, arguments); } + if (this.__is_starting_edition) { + return; + } + this.__is_starting_edition = true; var self = this; var args = arguments; @@ -839,6 +843,8 @@ ListView.List.include(/** @lends instance.web.ListView.List# */{ focus_field: $(event.target).not(".o_readonly").data('field'), }).fail(function() { return _super.apply(self, args); // The record can't be edited so open it in a modal (use-case: readonly mode) + }).always(function () { + self.__is_starting_edition = false; }); }, /**