[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:
Raphael Collet
2017-04-12 17:15:03 +02:00
parent f10ef71f06
commit 975086c039
+1 -1
View File
@@ -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))