[FIX] fields: correct detection of new records on relational fields

This commit is contained in:
Christophe Simonis
2016-10-17 14:51:37 +02:00
parent ceb1ba6dbd
commit ba6ca788fd
+1 -1
View File
@@ -872,7 +872,7 @@ class Field(object):
write_value = self.convert_to_write(self.convert_to_record(value, record), record)
record.write({self.name: write_value})
# Update the cache unless value contains a new record
if all(getattr(value, '_ids', ())):
if not (self.relational and not all(value)):
record._cache[self] = value
############################################################################