summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Smet <las@odoo.com>2018-10-08 08:52:05 +0000
committerLaurent Smet <las@odoo.com>2018-10-08 09:06:24 +0000
commit2d242b1ed9f03a765f17f6cbdef39ff259698202 (patch)
treebd2141aae22260b8fac98dbe80e6b07135d60ae0
parentd4d820f0bbdadab1dd1c33b2e14b6b94b16a7f2c (diff)
[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
-rw-r--r--addons/account/static/src/js/reconciliation/reconciliation_model.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js
index fcfc5f35ab7..cff4d7b91be 100644
--- a/addons/account/static/src/js/reconciliation/reconciliation_model.js
+++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js
@@ -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);