summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/form_relational_widgets.js
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-11-17 17:04:30 +0100
committerDenis Ledoux <dle@odoo.com>2015-11-17 17:07:31 +0100
commit2b1b0e6d13057e5e35625641310ca45f53b583d4 (patch)
treed565d804c0cbed56c2bff8fc4701f283d14f082c /addons/web/static/src/js/views/form_relational_widgets.js
parent9325cd054ab04c226b8f8acbc76d290f24281d23 (diff)
[FIX] web: editable list validation with several pages
This revision is related to a9d20d9fa04b1dbb350663652e0996e258ac6d31. `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
Diffstat (limited to 'addons/web/static/src/js/views/form_relational_widgets.js')
-rw-r--r--addons/web/static/src/js/views/form_relational_widgets.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/form_relational_widgets.js b/addons/web/static/src/js/views/form_relational_widgets.js
index 3a3c2208e58..d31d923b870 100644
--- a/addons/web/static/src/js/views/form_relational_widgets.js
+++ b/addons/web/static/src/js/views/form_relational_widgets.js
@@ -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);