From 252b6fb378e6d4b9fec2cd03f9a0f64b5227bd7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 5 May 2019 19:33:48 +0200 Subject: [PATCH] Do not rely on field views to load form fields If the views attribute of the field is wrong or empty, the record will not load the value for this field. The views attribute can be empty if it was created by copying the field from its parent. So it is safer to not rely on this attribute which is there only for optimization and instead always use all the fields defined on the view. issue8289 review263471002 --- src/view/form.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/view/form.js b/src/view/form.js index 3cbdf726f0..adefbf16c1 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -248,15 +248,13 @@ function eval_pyson(value){ // Force to set fields in record // Get first the lazy one from the view to reduce number of requests var fields = []; - for (name in record.model.fields) { + for (name in this.widgets) { field = record.model.fields[name]; - if (field.views.has(this.view_id)) { - fields.push([ - name, - field.description.loading || 'eager' == 'eager', - field.views.size, - ]); - } + fields.push([ + name, + field.description.loading || 'eager' == 'eager', + field.views.size, + ]); } fields.sort(function(a, b) { if (!a[1] && b[1]) {