[FIX] web: correctly apply changes on relational fields

The relational record may contain relational fields as well.
This commit is contained in:
Aaron Bohy
2017-04-11 19:44:38 +02:00
parent 95c33aee1c
commit b1bba768f2
@@ -1154,9 +1154,7 @@ var BasicModel = AbstractModel.extend({
defs.push(this.addDefaultRecord(list.id));
break;
case 'UPDATE':
var changedRecord = this.localData[command.id];
changedRecord._changes = changedRecord._changes || {};
_.extend(changedRecord._changes, _.pick(command.data, list.fieldNames));
defs.push(this.notifyChanges(command.id, command.data));
break;
case 'REMOVE':
list._changes = _.without(list._changes, command.id);