[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
This commit is contained in:
@@ -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;
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user