Declare vals_to_set on the common block where it is used
e38f22986aac reuse vals_to_set later so linter may complain about it not being defined.
This commit is contained in:
+7
-3
@@ -2514,6 +2514,7 @@
|
||||
}
|
||||
|
||||
if (value && (value.add || value.update)) {
|
||||
let vals_to_set = {};
|
||||
// First set already added fields to prevent triggering a
|
||||
// second on_change call
|
||||
if (value.update) {
|
||||
@@ -2523,9 +2524,9 @@
|
||||
}
|
||||
const record2 = group.get(vals.id);
|
||||
if (record2) {
|
||||
var vals_to_set = {};
|
||||
for (var key in vals) {
|
||||
if (!Object.prototype.hasOwnProperty.call(new_field_names, key)) {
|
||||
if (!Object.prototype.hasOwnProperty.call(
|
||||
new_field_names, key)) {
|
||||
vals_to_set[key] = vals[key];
|
||||
}
|
||||
}
|
||||
@@ -2561,7 +2562,10 @@
|
||||
if (record2) {
|
||||
let to_update = Object.fromEntries(
|
||||
Object.entries(vals).filter(
|
||||
([k, v]) => !Object.prototype.hasOwnProperty.call(vals_to_set, k)
|
||||
([k, v]) => {
|
||||
!Object.prototype.hasOwnProperty.call(
|
||||
vals_to_set, k)
|
||||
}
|
||||
));
|
||||
record2.set_on_change(to_update);
|
||||
}
|
||||
|
||||
@@ -861,6 +861,7 @@ class O2MField(Field):
|
||||
force_remove=False)
|
||||
|
||||
if value and (value.get('add') or value.get('update', [])):
|
||||
vals_to_set = {}
|
||||
# First set already added fields to prevent triggering a
|
||||
# second on_change call
|
||||
for vals in value.get('update', []):
|
||||
|
||||
Reference in New Issue
Block a user