[FIX] web: fetch name_gets on list only when there are data

Revision on 8ac98fc78a

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.
This commit is contained in:
Alexandre Kühn
2018-05-23 09:43:12 +02:00
parent c587c0029b
commit 8dbebe0242
@@ -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;