Do not rely on depends to select the fields to read in form view

issue11134
review389681019
This commit is contained in:
Nicolas Évrard committed 2022-01-31 22:25:58 +01:00
1 parent 6be0df6001
commit 6670cb0cc7
1 file changed
+6 -11
+6 -11
View File
@@ -313,19 +313,14 @@ function eval_pyson(value){
if (record) {
// Force to set fields in record
// Get first the lazy one from the view to reduce number of requests
var field_names = new Set();
for (name in this.widgets) {
depends = (
record.model.fields[name].description.depends || []);
field_names.add(name);
for (var i = 0; i < depends.length; i++) {
var depend = depends[i];
if (!depend.startsWith('_parent') &&
depend in record.model.fields) {
field_names.add(depend);
}
var field_names = new Set(this.get_fields());
for (name in record.model.fields) {
field = record.model.fields[name];
if (~field.views.indexOf(this.view_id)) {
field_names.add(name);
}
}
var fields = [];
field_names.forEach(function(fname) {
field = record.model.fields[fname];