[FIX] models: new() cannot not trigger any recomputation

Set the flag `validate=False` to prevent `convert_to_cache` on x2many
fields from triggering recomputations with command 1 (update).
This commit is contained in:
Raphael Collet
2019-06-13 15:01:29 +00:00
parent 26bf8ca880
commit be560c2828
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -2329,7 +2329,10 @@ class _RelationalMulti(_Relational):
ids.add(comodel.new(command[2], ref=command[1]).id)
elif command[0] == 1:
line = browse(command[1])
line.update(command[2])
if validate:
line.update(command[2])
else:
line._update_cache(command[2], validate=False)
ids.add(line.id)
elif command[0] in (2, 3):
ids.discard(browse(command[1]).id)
+2 -2
View File
@@ -5018,7 +5018,7 @@ Fields:
if origin is not None:
origin = origin.id
record = self.browse([NewId(origin, ref)])
record._update_cache(values)
record._update_cache(values, validate=False)
return record
@property
@@ -5596,7 +5596,7 @@ Fields:
# store changed values in cache, and update snapshot0
for name, value in changed_x2many.items():
record._update_cache({name: value})
record._update_cache({name: value}, validate=False)
snapshot0.fetch(name)
# determine which field(s) should be triggered an onchange