From 8dbebe02429363b88c4beeed7e24c806d9d9560d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Tue, 22 May 2018 09:57:00 +0200 Subject: [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. --- addons/web/static/src/js/views/basic/basic_model.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') 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; -- cgit v1.2.3