summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-03-24 16:34:37 +0100
committerqsm-odoo <qsm@odoo.com>2017-03-27 10:35:55 +0200
commiteac7e16e2008157fc797a3f5b996bda97efceb44 (patch)
tree2562b063dc1e8e358c8a4480196709b0eae528e7 /addons/web/static/src
parent92d25e7f0845480812bf04e0536785bd4c919bc5 (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/list_view_editable.js6
1 files changed, 6 insertions, 0 deletions
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;
});
},
/**