[FIX] web: can't saved X2Many list editable if a deleted record is invalid

The widget test if all lines are valid to save the view, but the test include the removed lines (eg: required field).
This commit is contained in:
Christophe Matthieu
2016-09-26 10:12:15 +02:00
parent 2a893606ae
commit 34efcb498d
@@ -973,7 +973,7 @@ var X2ManyListView = ListView.extend({
field.no_rerender = true;
current_values[field.name] = field.get('value');
});
var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values)});
var cached_records = _.filter(this.dataset.cache, function(item){return !_.isEmpty(item.values) && !item.to_delete;});
var valid = _.every(cached_records, function(record){
_.each(fields, function(field){
var value = record.values[field.name];