Skip to content
Permalink
Browse files

fixup! [IMP] web: allow mass update in editable list

  • Loading branch information...
mge-odoo committed Mar 21, 2019
1 parent cb6477b commit f61ff7838b208ea5363928366acbbf6a66e17e51
Showing with 7 additions and 17 deletions.
  1. +7 −17 addons/web/static/src/js/views/list/list_model.js
@@ -42,7 +42,9 @@ odoo.define('web.ListModel', function (require) {
*/
saveRecords: function (referenceRecordId, recordIds) {
var self = this;
var changes = this._generateChanges(this.localData[referenceRecordId], {});
var referenceRecord = this.localData[referenceRecordId];
var list = this.localData[referenceRecord.parentID];
var changes = this._generateChanges(referenceRecord, {});
var records = recordIds.map(function (recordId) {
return self.localData[recordId];
});
@@ -69,22 +71,10 @@ odoo.define('web.ListModel', function (require) {
self._parseServerData(fieldNames, record, record.data);
});
}).then(function () {
// TODO: this is a naive implementation ; should be done in
// batch (but in basic model, only batch for a list dp)
// Note that for a x2m field, the data will be the same for all
// records --> maybe read it once and copy data? (care for
// onchange)
var proms = [];
records.forEach(function (record) {
proms.push(self._fetchX2Manys(record));
proms.push(self._fetchReferences(record));
});
return Promise.all(proms).then(function () {
var proms = records.map(function (record) {
return self._postprocess(record);
});
return Promise.all(proms);
});
return Promise.all([
self._fetchX2ManysBatched(list),
self._fetchReferencesBatched(list)
]);
});
},

0 comments on commit f61ff78

Please sign in to comment.
You can’t perform that action at this time.