Use for...in to iterate over field names from the list of values
The elements of list of values are objects. Also we can use a Set instead of an object to build the unique list of field names. issue11415 review407291002
This commit is contained in:
1 parent
e7b1b20e60
commit
ae91f75cdf
1 file changed
+5
-5
+5
-5
@@ -2107,20 +2107,20 @@
|
||||
}
|
||||
if (mode == 'list values') {
|
||||
var context = this.get_context(record);
|
||||
var field_names = {};
|
||||
let field_names = new Set();
|
||||
for (const val of value) {
|
||||
for (var fieldname of val) {
|
||||
for (const fieldname in val) {
|
||||
if (!(fieldname in group.model.fields) &&
|
||||
(!~fieldname.indexOf('.'))) {
|
||||
field_names[fieldname] = true;
|
||||
field_names.add(fieldname);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!jQuery.isEmptyObject(field_names)) {
|
||||
if (field_names.size) {
|
||||
var args = {
|
||||
'method': 'model.' + this.description.relation +
|
||||
'.fields_get',
|
||||
'params': [Object.keys(field_names), context]
|
||||
'params': [Array.from(field_names), context]
|
||||
};
|
||||
var fields;
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user