[FIX] document: root dir is not display

bzr revid: hmo@tinyerp.com-20100127073503-c7lslmbx1b8kv6tn
This commit is contained in:
Harry (Open ERP) 2010-01-27 13:05:03 +05:30
parent 14a50c5a61
commit 7650fdaed1
2 changed files with 9 additions and 7 deletions

View File

@ -65,6 +65,7 @@ class document_directory(osv.osv):
objid=self.pool.get('ir.model.data')
try:
mid = objid._get_id(cr, uid, 'document', 'dir_root')
return None # TODO: check why not display root dir
if not mid:
return None
except Exception, e:

View File

@ -184,13 +184,14 @@ class node_dir(node_class):
dc2.update(self.dctx)
dc2['dir_id'] = self.dir_id
self.displayname = dirr.name
for dfld in dirr.dctx_ids:
try:
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
except Exception,e:
print "Cannot eval %s" % dfld.expr
print e
pass
if dirr.dctx_ids:
for dfld in dirr.dctx_ids:
try:
self.dctx['dctx_' + dfld.field] = safe_eval(dfld.expr,dc2)
except Exception,e:
print "Cannot eval %s" % dfld.expr
print e
pass
def children(self,cr):
return self._child_get(cr) + self._file_get(cr)