document: fix for directory.get_full_path()
authorP. Christeas <p_christ@hol.gr>
Tue, 12 Oct 2010 11:44:36 +0000 (14:44 +0300)
committerP. Christeas <p_christ@hol.gr>
Tue, 12 Oct 2010 11:44:36 +0000 (14:44 +0300)
The trunk ORM would call this function with dir_id=[id,] rather than
the pg84's dir_id=id argument.

bzr revid: p_christ@hol.gr-20101012114436-9xtfjm3oe1oj7d3f

addons/document/document_directory.py

index 2b3aad8..0c49bb5 100644 (file)
@@ -126,6 +126,10 @@ class document_directory(osv.osv):
     def get_full_path(self, cr, uid, dir_id, context=None):
         """ Return the full path to this directory, in a list, root first
         """
+        if isinstance(dir_id, (tuple, list)):
+            assert len(dir_id) == 1
+            dir_id = dir_id[0]
+
         def _parent(dir_id, path):
             parent=self.browse(cr, uid, dir_id)
             if parent.parent_id and not parent.ressource_parent_type_id: