[FIX] osv_pool: it appears it is necessary to have the model in the pool earlier on.
bzr revid: vmt@openerp.com-20110527100310-qw9760rd8spiwjgm
This commit is contained in:
parent
a87ebe9600
commit
ee58f9da5f
|
@ -639,6 +639,7 @@ class orm_template(object):
|
|||
|
||||
def __init__(self, pool, cr):
|
||||
""" Initialize a model and make it part of the given registry."""
|
||||
pool.add(self._name, self)
|
||||
self.pool = pool
|
||||
|
||||
if not self._name and not hasattr(self, '_inherit'):
|
||||
|
|
|
@ -243,9 +243,7 @@ class osv_pool(object):
|
|||
# Instanciate classes registered through their constructor and
|
||||
# add them to the pool.
|
||||
for klass in module_class_list.get(module, []):
|
||||
inst = klass.createInstance(self, module, cr)
|
||||
self.add(inst._name, inst)
|
||||
res.append(inst)
|
||||
res.append(klass.createInstance(self, module, cr))
|
||||
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in New Issue