From 2611c22efeb67f1de1712bb2643b9c5489e080a9 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 21 Jun 2012 12:09:00 +0200 Subject: [PATCH] [FIX] orm: make sure all *Model classes define _auto,_register,_transient This is required to avoid strange mro() pitfalls where an AbstractModel is inherited by a Model, and the _auto=False of AbstractModel ends up first in the mro() because Model does not explicitly define it, and the BaseModel default _auto is farther in the mro(). lp bug: https://launchpad.net/bugs/1013566 fixed bzr revid: odo@openerp.com-20120621100900-xejo9yhgx36kyh03 --- openerp/osv/orm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 5d2bfd388a8..d287db4be0b 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -5004,6 +5004,7 @@ class Model(BaseModel): The system will later instantiate the class once per database (on which the class' module is installed). """ + _auto = True _register = False # not visible in ORM registry, meant to be python-inherited only _transient = False # True in a TransientModel @@ -5016,6 +5017,7 @@ class TransientModel(BaseModel): records they created. The super-user has unrestricted access to all TransientModel records. """ + _auto = True _register = False # not visible in ORM registry, meant to be python-inherited only _transient = True @@ -5031,6 +5033,7 @@ class AbstractModel(BaseModel): """ _auto = False # don't create any database backend for AbstractModels _register = False # not visible in ORM registry, meant to be python-inherited only + _transient = False # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: