[FIX] web: use read to update record values after resequence
Commit: https://github.com/odoo/odoo/commit/818c18e55d0718286ff5bf332186a10f4d7a58ef Updated the resequence logic in a way that was almost falser than before. The added test however did work by coincidence, as index values were equal to the sequence field values. To be sure that we synchronize with what happens on the server, we do a read after the resequence. Additionnally, we take into account the result of the server resequence return; if it is false, it means no resequencing happened, so we should not do a read. opw 1867049 closes odoo/odoo#27184
This commit is contained in:
@@ -775,10 +775,14 @@ var MockServer = Class.extend({
|
||||
var offset = args.offset ? Number(args.offset) : 0;
|
||||
var field = args.field ? args.field : 'sequence';
|
||||
var records = this.data[args.model].records;
|
||||
if (!(field in this.data[args.model].fields)) {
|
||||
return false;
|
||||
}
|
||||
for (var i in args.ids) {
|
||||
var record = _.findWhere(records, {id: args.ids[i]});
|
||||
record[field] = Number(i) + offset;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* Simulate a 'search_count' operation
|
||||
|
||||
Reference in New Issue
Block a user