summaryrefslogtreecommitdiff
path: root/addons/document/document_directory.py
diff options
context:
space:
mode:
authorHarry (Open ERP) <hmo@tinyerp.com>2010-03-16 18:43:28 +0530
committerHarry (Open ERP) <hmo@tinyerp.com>2010-03-16 18:43:28 +0530
commit0db347d65f9c67f4b114a96874ea120cf7eacdee (patch)
tree14b476a2f5cfca2255c1a289b40a64ce35531dac /addons/document/document_directory.py
parent4b08bc496fe4945b25580d004b7f8745d00f7b15 (diff)
parentb509b2d0867f0283e7876c6ee636f7e18f48f11e (diff)
[MERGE] merged from lp:~openerp-commiter/openobject-addons/crm-improvement
bzr revid: hmo@tinyerp.com-20100316131328-lgttnpy712rqr7ga
Diffstat (limited to 'addons/document/document_directory.py')
-rw-r--r--addons/document/document_directory.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py
index 17c3dfb66d9..1557941e7c6 100644
--- a/addons/document/document_directory.py
+++ b/addons/document/document_directory.py
@@ -65,9 +65,10 @@ class document_directory(osv.osv):
objid=self.pool.get('ir.model.data')
try:
mid = objid._get_id(cr, uid, 'document', 'dir_root')
- return False # TODO: check why not display root dir
if not mid:
return False
+ root_id = objid.read(cr, uid, mid, ['res_id'])['res_id']
+ return root_id
except Exception, e:
import netsvc
logger = netsvc.Logger()
@@ -111,6 +112,21 @@ class document_directory(osv.osv):
res.append((d.id, s))
return res
+ def get_full_path(self, cr, uid, dir_id, context=None):
+ """ Return the full path to this directory, in a list, root first
+ """
+ def _parent(dir_id, path):
+ parent=self.browse(cr,uid,dir_id)
+ if parent.parent_id and not parent.ressource_parent_type_id:
+ _parent(parent.parent_id.id,path)
+ path.append(parent.name)
+ else:
+ path.append(parent.name)
+ return path
+ path = []
+ _parent(dir_id, path)
+ return path
+
def ol_get_resource_path(self,cr,uid,dir_id,res_model,res_id):
# this method will be used in process module
# to be need test and Improvement if resource dir has parent resource (link resource)