diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-05-22 09:57:00 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-05-23 09:43:12 +0200 |
| commit | 8dbebe02429363b88c4beeed7e24c806d9d9560d (patch) | |
| tree | ee2d69064ccb78ceddbbc2dc09fb44aefd5b7303 /addons/web/static/src | |
| parent | c587c0029b3211708f371b13c20b3efc7b6c9b43 (diff) | |
[FIX] web: fetch name_gets on list only when there are data
Revision on 8ac98fc78a3794e06481b02a431bcdc386a5a6ee
The commit above does not check whether the list contains data or not.
As a result, if there are no data in the list, there is no reason to
fetch `name_gets`.
In fact, there could be a traceback because some parameters of this rpc
are computed from data in the list. So if there are no data in the list,
the parameters of the rpc are undefined. This was the case for a test
in enterprise.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 36e9652dd9b..ea3b8f17a09 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1963,6 +1963,9 @@ var BasicModel = AbstractModel.extend({ var records = []; var ids = []; list = this._applyX2ManyOperations(list); + if (_.isEmpty(list.data)) { + return $.when(); + } _.each(list.data, function (localId) { var record = self.localData[localId]; var data = record._changes || record.data; |
