[FIX] fields: avoid invalidation of fields computed on new records
Issue: when a field is computed on a new record, the record is not marked as "being computed", and it could therefore be invalidated. The fix consists in using the standard method that marks records before calling the compute method.
This commit is contained in:
+1
-1
@@ -946,7 +946,7 @@ class Field(object):
|
||||
def determine_draft_value(self, record):
|
||||
""" Determine the value of ``self`` for the given draft ``record``. """
|
||||
if self.compute:
|
||||
self._compute_value(record)
|
||||
self.compute_value(record)
|
||||
else:
|
||||
record._cache[self] = SpecialValue(self.null(record.env))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user