diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-09-14 16:25:43 +0200 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2018-09-17 13:32:37 +0200 |
| commit | 8993d6ff796ffbac056f9808557d2dbfca01b62d (patch) | |
| tree | 650e93eb3408c54e7c9a5f6315fc6add25930942 /addons/web/static/src/js/fields/relational_fields.js | |
| parent | 4393e48fec93d2f0872f48bc4ad172b03c948c24 (diff) | |
[FIX] web: x2Many: remove deadlock situation
This rev. is similar to db9b91ff, but treats the x2many case.
Calls to the 'commitChange' function of renderers must not be done
inside a mutex, mainly since 241704536, as they could end up in a
deadlock. For x2manys, it was actually the case in practice in
Inventory > Operations > Inventory Adjustments > Create > select
'One product only' > select a product > try to edit the real
quantity in the editable list > focusout > deadlock.
The reason why the deadlock occurred in this view and not in, e.g.
sale.order, is due to the presence of the field_float_scannable
widget. Indeed, the barcode engine intercepts input events and
manually re-triggers them. As a consequence, the 'change' event is
not triggered on the field, and it does not notify the environment
of its new value by itself, until the field x2many asks it to
commit its value. Note that this might be an issue as well, as
onchanges are thus not triggered.
Task 1878254
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 4c92c0973b9..a1efa85498e 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -1221,18 +1221,14 @@ var FieldX2Many = AbstractField.extend({ _onSaveLine: function (ev) { var self = this; ev.stopPropagation(); - this.trigger_up('mutexify', { - action: function () { - return self.renderer.commitChanges(ev.data.recordID).then(function () { - self.trigger_up('mutexify', { - action: function () { - return self._saveLine(ev.data.recordID) - .done(ev.data.onSuccess) - .fail(ev.data.onFailure); - }, - }); - }); - }, + this.renderer.commitChanges(ev.data.recordID).then(function () { + self.trigger_up('mutexify', { + action: function () { + return self._saveLine(ev.data.recordID) + .done(ev.data.onSuccess) + .fail(ev.data.onFailure); + }, + }); }); }, /** |
