[FIX] account: fix $.when(defs) in reconciliation widget
Introduced by: https://github.com/odoo/odoo/commit/b0a29c9bad4fb9180ddcdae80529e244c6b61d49 Suppose def1, def2, def3, three deferred. $.when(def1, def2, def3) is ok $.when([def1, def2, def3]) is not ok $.when.apply($, [def1, def2, def3]) is ok closes odoo/odoo#27513
This commit is contained in:
@@ -510,13 +510,15 @@ var StatementModel = BasicModel.extend({
|
||||
line.mode = (id || line.mode !== "create") && isNaN(id) && !this.avoidCreate ? 'create' : 'match';
|
||||
defs.push(this._computeLine(line));
|
||||
if (line.mode === 'create') {
|
||||
return $.when(defs).then(function () {
|
||||
return $.when.apply($, defs).then(function () {
|
||||
return self.createProposition(handle);
|
||||
});
|
||||
} else if (line.mode === 'match') {
|
||||
return $.when(defs, self._performMoveLine(handle));
|
||||
return $.when.apply($, defs).then(function () {
|
||||
return self._performMoveLine(handle);
|
||||
});
|
||||
}
|
||||
return $.when(defs);
|
||||
return $.when.apply($, defs);
|
||||
},
|
||||
searchBalanceAmount: function (handle) {
|
||||
var line = this.getLine(handle);
|
||||
|
||||
Reference in New Issue
Block a user