[FIX] web: repair length field in view list
Underscore method _.each expects an array like object when a "length" property is present. This was an issue with a record having a numeric "length" field set to a non-negative value. When changing a line the change would not appear on blur. This issue was fixed with0e664c9e9but introduced back withf0e331e00. opw-691070 Forward-port of5d17749ff4which has been forgotten during previous forward-port.
This commit is contained in:
committed by
Christophe Simonis
parent
477e69d850
commit
25616b9f2b
@@ -560,11 +560,12 @@ var ListView = View.extend( /** @lends instance.web.ListView# */ {
|
||||
self.records.remove(record);
|
||||
return;
|
||||
}
|
||||
_.each(values, function (value, key) {
|
||||
// _.each is broken if a field "length" is present
|
||||
for (var key in values) {
|
||||
if (fields[key] && fields[key].type === 'many2many')
|
||||
record.set(key + '__display', false, {silent: true});
|
||||
record.set(key, value, {silent: true});
|
||||
});
|
||||
record.set(key, values[key], {silent: true});
|
||||
}
|
||||
record.trigger('change', record);
|
||||
|
||||
/* When a record is reloaded, there is a rendering lag because of the addition/suppression of
|
||||
|
||||
Reference in New Issue
Block a user