From: Raphael Collet Date: Tue, 2 Dec 2014 13:20:52 +0000 (+0100) Subject: [FIX] fields: inherited fields get their attribute 'state' from their base field X-Git-Url: http://git.inspyration.org/?p=odoo%2Fodoo.git;a=commitdiff_plain;h=591e329bb0efe4997677a0bee2e6f3b558e35df8 [FIX] fields: inherited fields get their attribute 'state' from their base field --- diff --git a/openerp/fields.py b/openerp/fields.py index 67c7991..88a6fe8 100644 --- a/openerp/fields.py +++ b/openerp/fields.py @@ -474,6 +474,10 @@ class Field(object): self._free_attrs.append(attr) setattr(self, attr, getattr(field, attr)) + # special case for states: copy it only for inherited fields + if not self.states and self.inherited: + self.states = field.states + # special case for required: check if all fields are required if not self.store and not self.required: self.required = all(field.required for field in fields)