[FIX] models: avoid wild prefetching when serializing onchange results
We fell on a strange situation in method `onchange`, where some data was missing from cache when serializing the result. In that case, the prefetching overwrites so many stuff in cache that the results of the onchanges are lost. Don't let that happen.
This commit is contained in:
+5
-4
@@ -5031,10 +5031,11 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
|
||||
subtree = subtree[name]
|
||||
|
||||
# collect values from dirty fields
|
||||
result['value'] = {
|
||||
name: self._fields[name].convert_to_onchange(record[name], record, subnames[name])
|
||||
for name in dirty
|
||||
}
|
||||
with env.do_in_onchange():
|
||||
result['value'] = {
|
||||
name: self._fields[name].convert_to_onchange(record[name], record, subnames[name])
|
||||
for name in dirty
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user