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.
(grafted from 81360b8ae682fb56f85d4ad6f5f779e0418cc3ce)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2025-04-30 08:44:05 +02:00
parent 690f3757a3
commit f2bd578f2f
2 changed files with 8 additions and 3 deletions
+7 -3
View File
@@ -2461,6 +2461,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) {
@@ -2470,9 +2471,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];
}
}
@@ -2508,7 +2509,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);
}
@@ -833,6 +833,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', []):