summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-12-23 16:16:39 +0200
committerP. Christeas <p_christ@hol.gr>2010-12-23 16:16:39 +0200
commit8e8803e9df4067d2c04d37e603bae76b40ecb17d (patch)
tree74f1ce6e4a1dd8b4a7a29043b590927de85c2cf7 /addons/document/document.py
parent6d38e064e22553c980ff7c663779b13e5fec7d3f (diff)
document, caldav: revert changes that are not needed and spacing
Let's keep the diff against trunk-dev-addons1 only to things that make sense. bzr revid: p_christ@hol.gr-20101223141639-o13v6llljplpgl7s
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index 5e6fb4646ec..874fc8b8888 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -53,8 +53,7 @@ class document_file(osv.osv):
if context is None:
context = {}
fbrl = self.browse(cr, uid, ids, context=context)
-
- nctx = nodes.get_node_context(cr, uid, context=context)
+ nctx = nodes.get_node_context(cr, uid, context={})
# nctx will /not/ inherit the caller's context. Most of
# it would be useless, anyway (like active_id, active_model,
# bin_size etc.)
@@ -67,7 +66,9 @@ class document_file(osv.osv):
result[fbro.id] = base64.encodestring(data or '')
else:
result[fbro.id] = fnode.get_data_len(cr, fbro)
+
return result
+
#
# This code can be improved
#
@@ -178,7 +179,7 @@ class document_file(osv.osv):
ids2 = []
for fbro in self.browse(cr, uid, ids, context=context):
if ('parent_id' not in vals or fbro.parent_id.id == vals['parent_id']) \
- and ('name' not in vals or fbro.name == vals['name']) or not fbro.parent_id:
+ and ('name' not in vals or fbro.name == vals['name']):
ids2.append(fbro.id)
continue
fnode = nctx.get_file_node(cr, fbro)