From a4ea258176202a8904cda2abc5926ec1abcd1c7f Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 16 Feb 2016 18:07:32 +0100 Subject: [PATCH] [FIX] fields: company-dependent (property) fields should not be stored or copied --- openerp/fields.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openerp/fields.py b/openerp/fields.py index dbf3ebbd15e..aac91b7a977 100644 --- a/openerp/fields.py +++ b/openerp/fields.py @@ -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