From 9dec9c2863bb41a997510b7eedab1945412a6cb0 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Fri, 27 Aug 2010 10:38:09 +0300 Subject: [PATCH] Document: fix trivial errors. Seems that some patches have been mis-applied and some bugs re-appeared. Conflicts: document/nodes.py bzr revid: p_christ@hol.gr-20100827073809-vjhkiwagurpnn3id --- addons/document/nodes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index cf590dafdad..c78e0ece09f 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -644,7 +644,7 @@ class node_dir(node_database): if (not self.parent) and ndir_node: if not dbro.parent_id: raise IOError(errno.EPERM, "Cannot move the root directory!") - self.parent = self.context.get_dir_node(cr, dbro.parent_id.id) + self.parent = self.context.get_dir_node(cr, dbro.parent_id) assert self.parent if self.parent != ndir_node: @@ -1187,7 +1187,7 @@ class node_file(node_class): return '' def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False): - if ndir_node.context != self.context: + if ndir_node and ndir_node.context != self.context: raise NotImplementedError("Cannot move files between contexts") if (not self.check_perms(8)) and ndir_node.check_perms(2): @@ -1205,11 +1205,11 @@ class node_file(node_class): if (not self.parent): # there *must* be a parent node for this one - self.parent = self.context.get_dir_node(cr, dbro.parent_id.id) + self.parent = self.context.get_dir_node(cr, dbro.parent_id) assert self.parent ret = {} - if self.parent != ndir_node: + if ndir_node and self.parent != ndir_node: if not (isinstance(self.parent, node_dir) and isinstance(ndir_node, node_dir)): logger.debug('Cannot move file %r from %r to %r', self, self.parent, ndir_node) raise NotImplementedError('Cannot move files between dynamic folders')