[FIX] fixes AttributeError NoneType object has no attribute is_transient (lp:908875)
lp bug: https://launchpad.net/bugs/908875 fixed bzr revid: olt@tinyerp.com-20120323095511-3uswje6nqnzciqtm
This commit is contained in:
parent
5a5791474a
commit
775a3bca89
|
@ -67,7 +67,10 @@ class ir_model(osv.osv):
|
||||||
models = self.browse(cr, uid, ids, context=context)
|
models = self.browse(cr, uid, ids, context=context)
|
||||||
res = dict.fromkeys(ids)
|
res = dict.fromkeys(ids)
|
||||||
for model in models:
|
for model in models:
|
||||||
res[model.id] = self.pool.get(model.model).is_transient()
|
if self.pool.get(model.model):
|
||||||
|
res[model.id] = self.pool.get(model.model).is_transient()
|
||||||
|
else:
|
||||||
|
_logger.error('Missing model %s' % (model.model, ))
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def _search_osv_memory(self, cr, uid, model, name, domain, context=None):
|
def _search_osv_memory(self, cr, uid, model, name, domain, context=None):
|
||||||
|
@ -508,7 +511,9 @@ class ir_model_access(osv.osv):
|
||||||
model_name = model
|
model_name = model
|
||||||
|
|
||||||
# TransientModel records have no access rights, only an implicit access rule
|
# TransientModel records have no access rights, only an implicit access rule
|
||||||
if self.pool.get(model_name).is_transient():
|
if not (self.pool.get(model_name)):
|
||||||
|
_logger.error('Missing model %s' % (model_name, ))
|
||||||
|
elif self.pool.get(model_name).is_transient():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# We check if a specific rule exists
|
# We check if a specific rule exists
|
||||||
|
|
Loading…
Reference in New Issue