[MERGE] 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-20120621110825-ry8e5tktvwv3h4tm
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user