From: Raphael Collet Date: Tue, 14 Oct 2014 13:47:13 +0000 (+0200) Subject: [FIX] models: do not look up the registry class when building cls._fields X-Git-Tag: InsPy_8.0_01~4^2~7 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=94e7dc60504fd4b7290a89fbda66452ea17c071b;p=odoo%2Fodoo.git [FIX] models: do not look up the registry class when building cls._fields --- diff --git a/openerp/models.py b/openerp/models.py index 5f596cd..8123ec6 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -804,10 +804,11 @@ class BaseModel(object): "TransientModels must have log_access turned on, " \ "in order to implement their access rights policy" - # retrieve new-style fields and duplicate them (to avoid clashes with - # inheritance between different models) + # retrieve new-style fields (from above registry class) and duplicate + # them (to avoid clashes with inheritance between different models) cls._fields = {} - for attr, field in getmembers(cls, Field.__instancecheck__): + above = cls.__bases__[0] + for attr, field in getmembers(above, Field.__instancecheck__): if not field.inherited: cls._add_field(attr, field.new())