[FIX] fields: company-dependent (property) fields should not be stored or copied

This commit is contained in:
Raphael Collet
2016-03-03 16:47:05 +01:00
parent bc4561b26b
commit a4ea258176
+5 -1
View File
@@ -437,6 +437,10 @@ class Field(object):
# by default, related fields are not stored and not copied
attrs['store'] = attrs.get('store', False)
attrs['copy'] = attrs.get('copy', False)
if attrs.get('company_dependent'):
# by default, company-dependent fields are not stored and not copied
attrs['store'] = attrs.get('store', False)
attrs['copy'] = attrs.get('copy', False)
# fix for function fields overridden by regular columns
if not isinstance(attrs.get('origin'), (NoneType, fields.function)):
@@ -699,7 +703,7 @@ class Field(object):
if self.column:
return self.column
if not self.store and (self.compute or not self.origin):
if not self.store and (self.compute or not self.origin) and not self.company_dependent:
# non-stored computed fields do not have a corresponding column
return None