[FIX] web: editable list validation with several pages
This revision is related to a9d20d9fa0.
`dataset.cache` contains an item for each records, even
if the records hasn't been loaded in the cache. If a record
has not been loaded, only the record id is available, not
the other values. Thefore, this isn't possible to validate
the record values of records that have not been loaded
in the dataset cache.
opw-654013
This commit is contained in:
@@ -961,7 +961,8 @@ var X2ManyListView = ListView.extend({
|
||||
field.no_rerender = true;
|
||||
current_values[field.name] = field.get('value');
|
||||
});
|
||||
var valid = _.every(this.dataset.cache, function(record){
|
||||
var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values)});
|
||||
var valid = _.every(cached_records, function(record){
|
||||
_.each(fields, function(field){
|
||||
var value = record.values[field.name];
|
||||
field.set_value(_.isArray(value) && _.isArray(value[0]) ? [COMMANDS.delete_all()].concat(value) : value);
|
||||
|
||||
Reference in New Issue
Block a user