From 4052a14c95a0c7019a572acbc3d5a76a264de671 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Thu, 1 Jul 2010 20:51:32 +0300 Subject: [PATCH] Document: amend the API for the move_to(), allow rename It is better to have the same API for both move and rename. bzr revid: p_christ@hol.gr-20100701175132-qgbf7p4izkh844vg --- addons/document/nodes.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index 4ed36a45024..7c258ca0355 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -209,12 +209,14 @@ class node_class(object): def get_dav_eprop(self, cr, ns, prop): return None - def move_to(self, cr, fil_obj, ndir_obj, in_write=False): + def move_to(self, cr, fil_obj, ndir_obj, new_name=False, in_write=False): """ Move this node to a new parent directory. - fil_obj, can be None, is the browse object for the file, if already - available. - ndir_obj must be the browse object to the new doc.directory location, - where this node should be moved to. + @param fil_obj, can be None, is the browse object for the file, + if already available. + @param ndir_obj must be the browse object to the new doc.directory + location, where this node should be moved to. + @param new_name a name to rename this node to. If omitted, the old + name is preserved in_write: When called by write(), we shouldn't attempt to write the object, but instead return the dict of vals (avoid re-entrance). If false, we should write all data to the object, here, as if the